I have 100 non-negative columns in my dataframe and would like to create the log transformation of each of them in R. How do I accomplish this? I'd ideally like to retain the original variables name and append the suffix "_log" to the new variables.
21 Answer
Just do
newdata <- log(data)You can then do something like (untested)
names(newdata) <- paste0(names(data), "_log")