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

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?



Solution 1:[1]

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 ) )

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sirius