View source: R/datalow_utils.r
makedataset | R Documentation |
makedataset takes the components of a simplified data set and combines them into a standard structure suitable for use with datalowSA. It requires a vector called year, one called catch, optionally one called cpue (all vectors need to be the same length with gaps filled with NA), the species name, and its resilience. It returns a list containing all the required parts.
makedataset(year, catch, cpue = NA, species = "species", resilience = "low")
year |
a vector of years that contained fisheries data |
catch |
a vector of catches in each year |
cpue |
either a single NA (default) or a vector of cpue. Any gaps in the cpue time-series should be filled with NA |
species |
the species name in quotes |
resilience |
either verylow, low, medium, or high |
a list of fish, glb, props, agedata, and lendata, the last 3 NULL
## Not run:
year <- 1986:2016
catch <- c(112.9,206.3,95.7,183.1,147.4,198.9,102.1,235.5,247.8,426.8,448,577.4,
558.5,427.9,509.3,502.4,429.6,360.2,306.2,195.7,210,287.3,214.2,260.6,
272.2,356.9,345,282.7,285.1,237.8,233.3)
cpue <- c(1.2006,1.3547,1.0585,1.0846,0.9738,1.0437,0.7759,1.0532,1.284,1.3327,
1.4014,NA,NA,1.142,0.9957,0.8818,0.7635,0.7668,0.7198,0.5997,0.6336,
0.6936,0.8894,0.8644,0.8442,0.8427,0.8849,0.9964,0.9804,0.957,1.0629)
dat <- makedataset(year,catch,cpue,"dataspmbits","low")
dat
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.