0

In my_data I want to create new variables. I do not know how to give names to my new variables, taking into account that those new variables are inside the for loop.

for (i in 2:ncol(my_data)) {
sdev <- sd(my_data[,i])
my_data$colnames(my_data[i]) <- my_data[,i]/sd(my_data[,i])
}

I tried this way, but it doesn't work. There should be i new variables, and every variable should have different name. Thanks!

0 Answers0