[R] Random Forest Reading N/A's, I don't see them

Lost in R michael.hartye at principiscapital.com
Thu Dec 15 20:39:09 CET 2011


After checking the original data in Excel for blanks and running Summary(cm3)
to identify any null values in my data, I'm unable to identify an instances.
Yet when I attempted to use the data in Random Forest, I get the following
error. Is there something that Random Forest is reading as null which is not
actually null? Is there a better way to check for this?

> library(randomForest)
> system.time(
+ rf1 <- randomForest(as.matrix(cm3[,c(2:length(colnames(cm3)))]),
+ cm3[,1],data=cm3,ntree=50)
+ )
*Error in randomForest.default(as.matrix(cm3[, c(2:length(colnames(cm3)))]), 
: 
  NA/NaN/Inf in foreign function call (arg 1)
In addition: Warning message:
In storage.mode(x) <- "double" : NAs introduced by coercion
Timing stopped at: 1.33 0.01 1.35 *


Thanks in advance,
Mike

--
View this message in context: http://r.789695.n4.nabble.com/Random-Forest-Reading-N-A-s-I-don-t-see-them-tp4201546p4201546.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list