Re: [R] CART for 0/1 data

From: Dave Roberts <>
Date: Sat 24 Sep 2005 - 01:08:38 EST


     If the data are actually coded 0/1, the tree function would probably intepret them as integers and try a regression instead of a classification. If the dependent variable is called "var", try

x <- tree(factor(var)~species)

David W. Roberts                                     office 406-994-4548
Professor and Head                                      FAX 406-994-3190
Department of Ecology                         email
Montana State University
Bozeman, MT 59717-3460

Martin Wegmann wrote:
> Dear R-user,
> I tried to generate classification / regression tree with a absence/presence
> matrix of species (400) in different locations (50) to visualise species
> which are important for splitting up two locations.
> Rpart and tree did not work for more than 10 species which is logical due to
> the limited amount of locations (n=50). However the error prompt is a "+" and
> no specific message, but I am pretty sure that I did not enter a false sign
> by mistake.
> Is it allowed at all to use 0/1 data for this statistical technique and if yes
> is there a way or different method to use all 400 species entries?
> Otherwise I would apply a PCA beforehand but I would prefer to have the raw
> species informations.
> using R 2.1.1-1 (debian repos.)
> regards, Martin
> mailing list PLEASE do read the posting guide! Received on Sat Sep 24 01:18:09 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:26 EST