Error in svd(x, nu = 0, nv = k) : infinite or missing values in 'x'
I am using prcomp()
and got this error message. I tried to do a reprex but could not reproduce the error. I tried:
df[is.na(df)] <- 0##NA values to 0
df <-df[which(rowSums(df) > 0),]##rm rows with only zeros
df <- df[, colSums(df != 0) > 0]##rm cols with only zeros
df
is a data.frame, that is a list
and not numeric
. I have run out of ideas! What else could I try?