Created
October 19, 2016 13:56
-
-
Save DexGroves/f2a65e69b2bc8048e63a774b611bf646 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (i in 2:ncol(my_data)) { | |
varname <- colnames(my_data)[i] | |
# if you want to change varname somehow | |
# varname <- paste0(varname, "new") | |
my_data[[varname]] <- my_data[,i]/sd(my_data[,i]) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment