bootr.strat | R Documentation |
Bootstrap discard rate with stratification bootstraps Cochran discard rate from a set of observed trips
bootr.strat(
bdat,
ddat,
focal_year = 2015,
strata_name = "strata",
strata_complete = NULL,
coverage = NULL,
keep.samps = F,
...
)
bdat |
observer data with strata column |
ddat |
dmis data (commercial trips) with strata column |
coverage |
proportion of commercial trips observed (i.e., observer coverage), which can optionally be specified to explore different coverages [default is observed coverage] |
keep.samps |
option to keep samples for each bootstrap (default = F) |
... |
additional arguments to |
days |
number of days to calculate starting from the first day of the fishing year |
This function runs a single instance with resampled observer data. It may be parallelized easily (see example). This requires mcoptions from setup.parallel
. Including strata_complete is strongly recemmended.
list of resampled discard rates
samp.by.strat
nboot = 10
mcoptions = setup.parallel()
bout.list = foreach(1:nboot, .options.multicore = mcoptions) %dopar% {
library(discaRd)
discaRd::bootr.strat(bdat = bdat, ddat = ddat, focal_year = 2015, nboot = nboot, strata_name = 'strata', strata_complete = strata_complete)
}
plot(colSums(bout.list[[1]]), typ='l', ylim = c(0,100000), xlab='Day of year', ylab = 'Discard')
for(i in 2:length(bout.list)){
lines(colSums(bout.list[[i]]), typ='l', col =2, lty = 2)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.