0

I need to scale my dataframe, I want to perform clustering. I used scale() function and it did well, but it turns my dataset into a matrix. when I want to use ggplot to show clustering on some variables, ggplot does not accept the scaled data, because i think it's a matrix. now i tried to use as.dataframe() to turn the scaled dataset back to dataframe, but all the variables from header row, are not shifted to column 1 and instead of them there are some Var1, Var2, Var3,..... is there a way that i can scale my dataframe without chaning anything, i want my dataframe look exactly the same after scaling.

0 Answers0