yearSample | R Documentation |
A resample from an FLQuant object along the 'year' dimension is returned. The 'year' dimnames of the output object can be specified, although that is not needed if the resample is to be assigned in a slot.
yearSample(x, size = length(years), years, replace = TRUE, prob = NULL)
x |
An FLQuant object. |
size |
Number of samples (years), non-negative integer. |
years |
Optional vector to set as 'year' dimnames in output. |
replace |
should sampling be with replacement? Defaults to TRUE. |
prob |
a vector of probability weights. |
RETURN Description, class
Iago Mosqueira (WMR)
FLQuant sample()
data(ple4)
# Take 20 samples of recent recruitment
yearSample(rec(ple4)[, ac(2013:2017)], 20)
# Providing 'years' sets the output object dimnames
yearSample(rec(ple4)[, ac(2013:2017)], 20, year=2000:2019)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.