I am trying to store a couple numbers for each partition, in a subset of the partitions of my data set. Of course, one can accomplish this using a binary tree. (The first split is on inclusion/exclusion of the first object, and so on.) I can probably simulate a tree using vectors. (One vector gives the index of left child node, another the index of the right child node.) However, it seems like there must be a useful class associated with the clustering or recursive partitioning procedures, perhaps not out there for everyone to see. I poked around on the R page and didn't see anything that clearly met my needs very directly. I hope I would not have to learn recursive partitioning in R to find what I need.
Have you had a look at the rpart package? If you haven't installed it it may be worth doing so. Then you can type require(rpart) ?rpart.object Tom> -----Original Message----- > From: DFARRAR [mailto:DFARRAR at vt.edu] > Sent: Monday, 6 December 2004 11:09 AM > To: r-help at stat.math.ethz.ch > Subject: [R] tree class in R? > > > I am trying to store a couple numbers for each partition, in > a subset of the > partitions > of my data set. Of course, one can accomplish this using a > binary tree. (The > first split is on > inclusion/exclusion of the first object, and so on.) I can > probably simulate > a tree using > vectors. (One vector gives the index of left child node, > another the index of > the right child node.) > However, it seems like there must be a useful class > associated with the > clustering > or recursive partitioning procedures, perhaps not out there > for everyone to > see. I poked around > on the R page and didn't see anything that clearly met my > needs very directly. > I hope I would not > have to learn recursive partitioning in R to find what I need. > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html >
Hi all, I'm a new user of R gam() function. I am wondering how do we decide on the smooth function to use? The general form is gam(y~s(x1,df=i)+s(x2,df=j).......) , how do we decide on the degree freedom to use for each smoother, and if we shold apply smoother to each attribute? Thanks!!
DFARRAR <DFARRAR <at> vt.edu> writes: : : I am trying to store a couple numbers for each partition, in a subset of the : partitions : of my data set. Of course, one can accomplish this using a binary tree. (The : first split is on : inclusion/exclusion of the first object, and so on.) I can probably simulate : a tree using : vectors. (One vector gives the index of left child node, another the index of : the right child node.) : However, it seems like there must be a useful class associated with the : clustering : or recursive partitioning procedures, perhaps not out there for everyone to : see. I poked around : on the R page and didn't see anything that clearly met my needs very directly. : I hope I would not : have to learn recursive partitioning in R to find what I need. Do a search of the r-help archives. There was binary tree code posted within the last year.
>>>>> "DFARRAR" == DFARRAR <DFARRAR at vt.edu> >>>>> on Sun, 5 Dec 2004 22:09:02 -0500 writes:DFARRAR> I am trying to store a couple numbers for each DFARRAR> partition, in a subset of the partitions of my data DFARRAR> set. Of course, one can accomplish this using a DFARRAR> binary tree. (The first split is on DFARRAR> inclusion/exclusion of the first object, and so DFARRAR> on.) I can probably simulate a tree using vectors. DFARRAR> (One vector gives the index of left child node, DFARRAR> another the index of the right child node.) DFARRAR> However, it seems like there must be a useful class DFARRAR> associated with the clustering or recursive DFARRAR> partitioning procedures, perhaps not out there for DFARRAR> everyone to see. I poked around on the R page and DFARRAR> didn't see anything that clearly met my needs very DFARRAR> directly. but maybe indirectly? There's the "dendrogram" class in R, --> "?dendrogram", which had been created with the aim to be a class that would allow both regression/classification trees and hierarchical cluster dendrograms to be represented. It's not just for binary trees, and definitely much nicer to use than a "vector simulation" version. DFARRAR> I hope I would not have to learn DFARRAR> recursive partitioning in R to find what I need. (well, it may be worth your time to learn something about rpart anyway; but you won't want to use it's representation of trees, I think) Martin Maechler, ETH Zurich