PCA in R: Error in svd(x, nu=0, nv=k) : Infinite or missing values in 'x'

Viewed 9950

My dataframe contains about 26k rows with 129 variables. I've made sure all of the variables are numeric and do not have any NA values (used na.omit). Using the function prcomp() on my dataframe tells me "Infinite or missing values in x". What might I be overlooking then?

1 Answers

Did you also make sure none of them are infinite? As that's the other part of that message?

Easily check all this with:

all( is.finite( your.data.frame ) )
Related