I have a string vector like this:
s <- c("X _1",
"X _2",
"X _3",
"X _4",
"X _5",
"X _6",
"X _7",
"X _8")
Is there a way of systematically renaming the variables such that, for example, X _1 becomes X_1?
Thanks!