Error in colMeans(x, na.rm = TRUE) : 'x' must be numeric

pca

#1

I am currently doing a problem using PCA in R to reduce dimension of data but while doing this I am getting error
Error in colMeans(x, na.rm = TRUE) : ‘x’ must be numeric
I am not able why I am getting this error.


#2

@harry- you are getting this error because there is some variable in your data set which are not numeric and PCA can be applied only to numeric data.

Hope this helps!
Regards,
hinduja1234