[R] Multiple regression trees-more info

fietz@dionea.ch fietz at dionea.ch
Mon Oct 11 17:27:19 CEST 2004


Sorry, as I was mentioned already I'm new in this field an thus I forgot to
tell more details:

I'm using R software 1.9.1 with the 'mvpart' package.

In the meantime I came closer to the solution of my problem, but I get an
error (see the script below). But I still don't have an idea how to label
each node with its corresponding number.
Annette


#require(mvpart)
eco.mvp <- mvpart(data.matrix(eco) ~ ., env, xv="p")
eco.mvp$where
eco.member <-eco.mvp$where
#find out the levels (in this case the end node number) of a factor
eco.memberf <- factor(eco.member)#define eco.member as factor
levels(eco.memberf) #numbers(labels) of end nodes

#find meanvalue for each response variable within each group (end node)
all.value <- c(eco$all) #extract column of response variable"all" with
values
allmeans.member <-(tapply(all.value,eco.memberf,mean))
allmeans.member

#number of occurency for each response variable within each end node
#require(vegan)
all0 <- decostand(all.value,"pa")
allcount.member <-(tapply(all0,eco.memberf,sum))

Error in tapply(all0c, eco.memberf, sum) :
        arguments must have same length




More information about the R-help mailing list