Read in the csv inputfile and create the data frames and matrices needed for the fitting, plots and tables: matdat.spawners, matdat.wildspawners, and metadata. Some clean up of names and runtiming is done.
data_setup(inputfile, min.year, max.year, fit.all = FALSE)
inputfile | .csv file. See demofiles for the proper format. |
---|---|
min.year | The minimum year for the returned data frames. If left off, it will use the minimum year in the data set. You can set later to exclude data or set before to hindcast. |
max.year | The maximum year for the returned data frames. If left off, it will use the maximum year in the data set. You can set earlier to exclude data or set later to forecast. |
fit.all | If TRUE, fit all and don't ask about names. |
A list with four items:
The raw data for the selected ESUs.
A matrix of the total spawners with NAs for missing years. Each column is a year from min.year to max.year and each row is a population.
A matrix of the the wildspawners using the fracwild data if included. NAs for years with either missing fracwild or missing spawner count. Each column is a year from min.year to max.year and each row is a population.
A data.frame with all the metadata for each population: name = population name, ESU = ESU name, Species, Run = run timing for population, PopGroup = name of the Major Population Group (within ESU), Method = data method (eg Survey or Model), Citation = citation, Contributor = Where the data come from.
NAs are specified with -99, -99.00 or -99.0.
Eli Holmes, NOAA, Seattle, USA. eli(dot)holmes(at)noaa(dot)gov