Hello, I've been using ctree and have developed a 55 node - 28 terminal solution. As can be imagined, the plot is difficult to travel down each of the major branches. I've read the help files for ctree I saw where terminal nodes can be color coded. plot(airct, type = "simple")> plot(airct, terminal_panel = node_boxplot(airct, col = "blue", + fill hsv(2/3, 0.5, 1)))Here is my question: Since my model has 55 nodes and 28 terminal nodes,(ie many branches) is it feasible to color code the each of the major branches and track the paths down the decision tree? R 2.11.1, Windox XP Thanks Steve Steve Friedman Ph. D. Spatial Statistical Analyst Everglades and Dry Tortugas National Park 950 N Krome Ave (3rd Floor) Homestead, Florida 33034 Steve_Friedman at nps.gov Office (305) 224 - 4282 Fax (305) 224 - 4147
Steve, I'm not sure if your task could be accomplished with a ready-made function in party. But, if you could manage to convert your tree structure to a dendrogram, then it's straightforward using dendrapply. In fact, there is an example in dendrapply help page showing how leaves are colored. ?dendrapply HTH. H -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Steve_Friedman at nps.gov Sent: Friday, July 09, 2010 10:22 AM To: r-help at r-project.org Subject: [R] Ctree Question Hello, I've been using ctree and have developed a 55 node - 28 terminal solution. As can be imagined, the plot is difficult to travel down each of the major branches. I've read the help files for ctree I saw where terminal nodes can be color coded. plot(airct, type = "simple")> plot(airct, terminal_panel = node_boxplot(airct, col = "blue", + fill hsv(2/3, 0.5, 1)))Here is my question: Since my model has 55 nodes and 28 terminal nodes,(ie many branches) is it feasible to color code the each of the major branches and track the paths down the decision tree? R 2.11.1, Windox XP Thanks Steve Steve Friedman Ph. D. Spatial Statistical Analyst Everglades and Dry Tortugas National Park 950 N Krome Ave (3rd Floor) Homestead, Florida 33034 Steve_Friedman at nps.gov Office (305) 224 - 4282 Fax (305) 224 - 4147 ______________________________________________ R-help at 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.
On Fri, 9 Jul 2010, Steve_Friedman at nps.gov wrote:> > Hello, > > I've been using ctree and have developed a 55 node - 28 terminal solution. > As can be imagined, the plot is difficult to travel down each of the major > branches. > > I've read the help files for ctree I saw where terminal nodes can be color > coded. > > plot(airct, type = "simple") >> plot(airct, terminal_panel = node_boxplot(airct, col = "blue", + fill > hsv(2/3, 0.5, 1))) > > Here is my question: > > Since my model has 55 nodes and 28 terminal nodes,(ie many branches) is it > feasible to color code the each of the major branches and track the paths > down the decision tree?I'm not sure what exactly you want: Is it to plot Node XY in a certain color, say blue, and also have all branches that lead to that node in blue? If so, you could in principle write a panel function for that but it wouldn't be easy, I'm afraid. Sorry, Z> R 2.11.1, Windox XP > > > Thanks > Steve > > > > Steve Friedman Ph. D. > Spatial Statistical Analyst > Everglades and Dry Tortugas National Park > 950 N Krome Ave (3rd Floor) > Homestead, Florida 33034 > > Steve_Friedman at nps.gov > Office (305) 224 - 4282 > Fax (305) 224 - 4147 > > ______________________________________________ > R-help at 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. >