# NOT RUN {
# Read in the 'simple' example SS model stored in r4ss
# Find the directory
dirsimple <- system.file("extdata", "simple_3.30.13", package = "r4ss")
# Read in the dat file to define the structure of the control file so that
# you don't have to specify things in the function call such as 'Nfleet'
datfilename <- dir(dirsimple, pattern = "data\\.ss", full.names = TRUE)
dat <- r4ss::SS_readdat(file = datfilename, verbose = FALSE)
# Read in the control file using a list object for datlist
ctl <- r4ss::SS_readctl(
file = dir(dirsimple, pattern = "control\\.ss", full.names = TRUE),
verbose = FALSE,
datlist = dat, use_datlist = TRUE
)
# Read in the control file using a file name for datlist
ctl <- r4ss::SS_readctl(
file = dir(dirsimple, pattern = "control\\.ss", full.names = TRUE),
verbose = FALSE,
datlist = datfilename, use_datlist = TRUE
)
# }
Run the code above in your browser using DataLab