powered by
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)
Returns a data frame with added variables.
A data frame to add variables to.
A range of variables to add, provided in the form: var_name1:var_name10.
# Example data frames my_data <- dummy_data(100) # Add variable range my_data <- my_data |> add_variable_range(status1:status12)
Run the code above in your browser using DataLab