I would appreciate your help.
I want to change variables' name in R. The name of variables is "CACRAGE", "CACRAA1", etc.
I want to remove "AC" in the middle, changing variables' name to "CRAGE", "CCRAA1".
I've tried the following expression and it does not work. Please help me!
gsub(pattern = '^CAC([A-Z]{3,}', replacement = '^C([A-Z]{3,}', colnames(milwaukee_test), fixed = TRUE)
Thank you.
CACRAA1the result will beCRAA1right? In that case you can match^CACand replace withCregex101.com/r/fy8Urk/1