subsample_catch | R Documentation |
Randomly choose a subset of observations for some or all vessels etc.
subsample_catch(catch_df, n_df = NULL)
catch_df |
Catch data frame to subset |
n_df |
Data frame specifiying how to subset |
Takes subsets of observations by year and other characteristics. Subsetting is specified as a data frame. Any unspecified levels are not subset.
A data frame with the same columns, subset as specified
John Best
## Not run: ## To subset the observations of a single vessel, only specify a number of ## observations for that vessel subsample_catch(catch_df, tibble(vessel_idx = 2, n = 1000)) ## To subset the observations for two vessels, specify a number of ## observations for each subsample_catch(catch_df, tibble(vessel_idx = c(1, 2), n = c(200, 1000))) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.