R - svd() function - infinite or missing values in 'x'
I am constantly getting this error. I am sure the matrix does not have any non-numeric entries. I also tried imputing the matrix, did not work. Anyone know what the error might be? fileUrl <- "https://dl.dropboxusercontent.com/u/76668273/kdd.csv"; download.file(fileUrl,destfile="./kdd.csv",method="curl"); kddtrain <- read.csv("kdd.csv"); kddnumeric <- kddtrain[,sapply(kddtrain,is.numeric)]; kddmatrix <- as.matrix(kddnumeric); svd1 <- svd(scale(kddmatrix)); You have columns composed of all zeroes. Using scale on a column of all zeroes returns a column composed of NaN . To solve this, remove