[R] tree error
Prof Brian Ripley
ripley at stats.ox.ac.uk
Wed Jun 7 17:15:02 CEST 2000
> Date: Wed, 7 Jun 2000 10:45:43 -0400 (EDT)
> From: Robert Schilling Schick <rss6 at duke.edu>
> To: r-help at stat.math.ethz.ch
> Subject: [R] tree error
>
> Hi- I'm trying to run a classification tree, and have received an error
> I'm unfamiliar with. Following is the R code, and the first 10 lines of
> my matrix. Any help would be appreciated.
>
> > kuv.tree <- read.table("kuv3_mantelmatrix.txt",header=T,sep="\t")
> > library(tree)
> > attach(kuv.tree)
> > ktree <- tree(Species ~ Drig + dwellln, data=kuv.tree)
> Error in arg == choices : comparison (1) is possible only for vector types
What does traceback() give you? That message is coming from match.arg.
By the way, if you want a classification tree, you had better have
Species as a factor, and it looks as if you have not. See the help page!
Usual questions:
Version of R?
Version of tree?
Are they the current ones?
Does example(tree) work for you?
If you can send me a reproducible example, I may be able to help.
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list