If you look at the help for predict.naiveBayes, you can see that newdata is
supposed to be a data.frame.  However, you are providing newdata as a
vector, titanic_small[,-1].  Try using titanic_small[,-1, drop=FALSE]
instead.

Jean

On Tue, Mar 12, 2013 at 11:35 PM, S. Zhou <myx...@yahoo.com> wrote:

> titanic_small[,-1]

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to