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)

Arguments

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.

Value

A list with four items:

dat

The raw data for the selected ESUs.

matdat.spawners

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.

matdat.wildspawners

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.

metadat

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.

Details

NAs are specified with -99, -99.00 or -99.0.

Author

Eli Holmes, NOAA, Seattle, USA. eli(dot)holmes(at)noaa(dot)gov