I have created a tree and want to save some of the
data so that I can create a html table from it.
I would like to save the output from data.ltr (see
example below) to a file, but haven't found a way to
do that, keeping the nice format that typing data.ltr
gives me (see output below). Is there a way to do
this?
Example:
library (maptree)
library (tree)
data<-read.csv("C:\\data.txt")
cnames<-colnames(data)
data$Vendor=as.factor(data$Vendor)
data$Yield=as.numeric(data$Yield)
data.ltr <- tree(Yield ~ ., data)
Output:> data.ltr
node), split, n, deviance, yval
* denotes terminal node
1) root 22 18.590 1.1360
2) X0100.WAFER.START.SCRIBE.PROD:
1TAGG3,1TAHK2,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
17 3.059 0.7647
4) e.F: 0,2,5 6 1.333 0.3333 *
5) e.F: 1,3,4 11 0.000 1.0000 *
3) X0100.WAFER.START.SCRIBE.PROD: 1TAHL7,NA,NA,NA 5
5.200 2.4000 *>
__________________________________________________
Do You Yahoo!?
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Thu, 18 Apr 2002, Don Stierman wrote:> I have created a tree and want to save some of the > data so that I can create a html table from it. > I would like to save the output from data.ltr (see > example below) to a file, but haven't found a way to > do that, keeping the nice format that typing data.ltr > gives me (see output below). Is there a way to do > this??sink.> > Example: > library (maptree) > library (tree) > data<-read.csv("C:\\data.txt") > cnames<-colnames(data) > data$Vendor=as.factor(data$Vendor) > data$Yield=as.numeric(data$Yield) > data.ltr <- tree(Yield ~ ., data) > > Output: > > data.ltr > node), split, n, deviance, yval > * denotes terminal node > > 1) root 22 18.590 1.1360 > 2) X0100.WAFER.START.SCRIBE.PROD: > 1TAGG3,1TAHK2,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA > 17 3.059 0.7647 > 4) e.F: 0,2,5 6 1.333 0.3333 * > 5) e.F: 1,3,4 11 0.000 1.0000 * > 3) X0100.WAFER.START.SCRIBE.PROD: 1TAHL7,NA,NA,NA 5 > 5.200 2.4000 * > > > > > __________________________________________________ > Do You Yahoo!? > > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > 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 > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Thu, 18 Apr 2002, Don Stierman wrote:> I have created a tree and want to save some of the > data so that I can create a html table from it. > I would like to save the output from data.ltr (see > example below) to a file, but haven't found a way to > do that, keeping the nice format that typing data.ltr > gives me (see output below). Is there a way to do > this?Look at sink() sink("filename") sends output to that file, and you can also send the output to a character vector by sink()ing to a textConnection() -thomas -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._