merge_strata | R Documentation |
Merges multiple pre-defined sampling strata into a single stratum.
merge_strata(data, strata, merge, name = NULL)
data |
a dataframe or matrix with one row for each sampling
unit, one column, |
strata |
a character string specifying the name of the column that defines each unit's current strata. |
merge |
the names of the strata to be merged, exactly as
they appear in |
name |
a character name for the new stratum. Defaults to NULL, which pastes the old strata names together to create the new stratum name. |
Returns the input dataframe with a new column named 'new_strata' that holds the name of the stratum that each sample belongs to after the merge. The column containing the previous strata names is retained and given the name 'old_strata'.
x <- merge_strata(iris,
strata = "Species",
merge = c("virginica", "versicolor"), name = "v_species"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.