# NOT RUN {
capl_demo_data <- get_capl_demo_data(n = 25)
str(capl_demo_data[, 1:2])
# 'data.frame': 25 obs. of 2 variables:
# $ age : int 11 9 10 11 9 8 11 9 10 12 ...
# $ gender: chr "Female" "Girl" "Girl" "f" ...
capl_demo_data <- rename_variable(
x = capl_demo_data,
search = c("age", "gender"),
replace = c("hello", "world")
)
str(capl_demo_data[, 1:2])
# 'data.frame': 25 obs. of 2 variables:
# $ hello: int 11 9 10 11 9 8 11 9 10 12 ...
# $ world: chr "Female" "Girl" "Girl" "f" ...
# }
Run the code above in your browser using DataLab