mfdb_aggregate_group {mfdb} | R Documentation |
MareFrame DB groups
Description
Represent a grouping of data to be applied when summarising area, timestep, age or length.
Usage
# Named grouping of discrete items
mfdb_group(...)
# Pre-baked mfdb_groups for timesteps
mfdb_timestep_yearly
mfdb_timestep_biannually
mfdb_timestep_quarterly
# Grouping of discrete items, names generated by prefix
mfdb_group_numbered(prefix, ...)
# make (count) mfdb_groups, by sampling (count) times from (group)
mfdb_bootstrap_group(count, group, seed = NULL)
Arguments
... |
For |
prefix |
When generating numeric group names, the character prefix to append to the beginning. |
group |
For |
count |
For |
seed |
For |
Value
An mfdb_aggregate
object that can then be used in querying functions
such as mfdb_sample_count
Examples
## Aggregate age into 2 groups. "young" (for ages 1--3) and
## "old" (for ages 4--6)
g1 <- mfdb_group(young = c(1,2,3), old = c(4,5,6))
## Aggregate areas into "area1" and "area2".
g2 <- mfdb_group_numbered("area", c(1011,1012,1013), c(1021,1022))
## Take 3 samples with replacement from each group in area
g3 <- mfdb_bootstrap_group(3, g2)