Re: [R] what is Non-numeric argument to mathematical function in prediction ?

2012-05-07 Thread kiinalist
Thanks. It does work now. I also get another problem when I use naivebayes and prediction in myapplication There was anerror message: Error in table(predict(nb.obj, test.data[, subset, drop = FALSE]), test.data[, : all arguments must have the same length The length of

[R] what is Non-numeric argument to mathematical function in prediction ?

2012-05-05 Thread kiinalist
Hi, I tried to use naivebayes in package 'e1071'. when I use following parameter, only one predictor, there is an error. m - naiveBayes(iris[,1], iris[,5]) table(predict(m, iris[,1]), iris[,5]) Error in log(sapply(attribs, function(v) { : Non-numeric argument to mathematical function

Re: [R] what is Non-numeric argument to mathematical function in prediction ?

2012-05-05 Thread Petr Savicky
On Sat, May 05, 2012 at 09:21:10AM +0300, kiinalist wrote: Hi, I tried to use naivebayes in package 'e1071'. when I use following parameter, only one predictor, there is an error. m - naiveBayes(iris[,1], iris[,5]) table(predict(m, iris[,1]), iris[,5]) Error in log(sapply(attribs,