This function will take a single variable and return the centered version of that variable. It can be used with the grouping parameter set to 'person_id' to get person-centered variables.
1 | center_cols(data, variables, grouping)
|
data |
The dataset to operate on. |
variables |
The character vector of variables to lag |
grouping |
The character vector of grouping variables |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.