Description Usage Arguments Details Value Author(s) Examples
View source: R/derive_var_obs_number.R
Adds a variable numbering the observations within each by group
1 2 3 4 5 6 7 | derive_var_obs_number(
dataset,
by_vars = NULL,
order = NULL,
new_var = ASEQ,
check_type = "none"
)
|
dataset |
Input dataset The variables specified by the |
by_vars |
Grouping variables Permitted Values: list of variables |
order |
Sort order Within each by group the observations are ordered by the specified order. Permitted Values: list of variables or functions of variables |
new_var |
Name of variable to create The new variable is set to the observation number for each by group. The numbering starts with 1. Default: |
check_type |
Check uniqueness? If Default: Permitted Values: |
For each group (with respect to the variables specified for the
by_vars
parameter) the first or last observation (with respect to the
order specified for the order
parameter and the mode specified for the
mode
parameter) is included in the output dataset.
A dataset containing all observations and variables of the input
dataset and additionally the variable specified by the new_var
parameter.
Stefan Bundfuss
1 2 3 4 5 6 7 8 9 10 11 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.