Error : cannot rescale a constant/zero column to unit variance

r
pca

#1

I am currently trying do a classification problem in which I have to reduce the dimension so I have used PCA technique but when I have implement PCA technique on data set I am getting error.

Error in prcomp.default(train, center = TRUE, scale = TRUE) :
cannot rescale a constant/zero column to unit variance


#2

It seems there are one or more column(s) in the dataset which have constant value throughout for all the rows.

Please check and remove those column(s) and try running the algorithm again. Thank you.