View source: R/small_helpers.R
| add_variable_range | R Documentation |
Add empty variables to a data frame in the provided range. Basically does in a data frame, what paste0("age", 1:10) does for a vector.
add_variable_range(data_frame, var_range)
data_frame |
A data frame to add variables to. |
var_range |
A range of variables to add, provided in the form: var_name1:var_name10. |
Returns a data frame with added variables.
# Example data frames
my_data <- dummy_data(100)
# Add variable range
my_data <- my_data |> add_variable_range(status1:status12)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.