Skip to content

Instantly share code, notes, and snippets.

@DexGroves
Created October 19, 2016 13:56
Show Gist options
  • Save DexGroves/f2a65e69b2bc8048e63a774b611bf646 to your computer and use it in GitHub Desktop.
Save DexGroves/f2a65e69b2bc8048e63a774b611bf646 to your computer and use it in GitHub Desktop.
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