powered by
Replace Prefix
repl_pref(x, pref, repl)
character
character; string to change
character; prefix to replace
character; prefix to replace with
x <- c('pop', 'pop_2020_est', 'pop_white_2020', 'pop_black_2020') repl_pref(x, 'pop_', 'p_')
Run the code above in your browser using DataLab