s-news
[Top] [All Lists]

[S] plot.tree question

To: "splus (E-mail)" <s-news@wubios.wustl.edu>
Subject: [S] plot.tree question
From: "Gibiansky, Leonid" <gibianskyl@globomax.com>
Date: Wed, 31 May 2000 09:04:42 -0400
Sender: owner-s-news@wubios.wustl.edu
Thanks to everyone who replied (Anne E. York, Terry Therneau, Nicole
DePriest, Greg Arnold,
Beth Atkinson, Brian D. Ripley, sorry if I missed someone), below is the
summary.

Original posting:
>
>I need to plot the tree, and I am using post.tree() function to do it.
>However, I need to include the plots into the Word document, and Word does
>not like .ps files. Is there any other plot.tree() function that would
>produce the plot of the tree, with all the necessary information included
>into the plot ? The default plot.tree function shows only branches, without
>names of the variables, predicted outcome, statistics etc.
>
>Thanks in advance,
>Leonid Gibiansky
>

Summary of solutions

1. You can get the label on the tree using 
labels(text(tree.objectname))

2. I've just realized that the problem may be simpler: you need to use
text.tree to add the splits, the predicted outcome, etc. 

Comment: still, post.tree plot is much nicer and simpler than the one you
can get by using text.tree function.

3. You don't mention what platform you are using but I get the impressions
it
is unix?  If so, the easiest way to import the graph into Word is to first
convert to a .gif file then import into Word.  ps2gif is a common method.
Also, the GNU software program, gimp, will do the necessary conversion as
well as enable you to edit the graph.  A web search on "gimp" should get
you to the necessary website.

I am on the NT machine, sorry to miss this in my original posting.

4. Try using rpart - it can do the same as tree, plus more.  You can see
the actual commands to post.rpart (as opposed to post.tree) and you can
modify as necessary.  You can then create a plot in whatever format you
want.
The unix version is available at http://www.mayo.edu/hsr/Sfunc.html
The Windows version is available via Brian Ripley - try RPart2.zip
 For the Windows version (S-Plus 3.x and 4.x), go to
http://www.stats.ox.ac.uk/pub/SWin/RPart.zip    (library)
http://www.stats.ox.ac.uk/pub/SWin/RPartdoc.zip (postscript docs)
(If you want to know more about rpart, the latest edition of Venables and
Ripley covers it, or grab the technical report from 
www.mayo.edu/hsr/biostat.html.) 

Comment: I am going to try it, but I am working in the regulated industry
and need to use validated, commercial software. As far as I understood,
rpart is not a part of standard S+, and I cannot use it, at least not for my
current project.

5. I have just 'upgraded' to a new version of Word and found it would 
not recognize .ps files.  The solution turned out to be simple - 
change the suffix to .eps.  You do need to have the right filters 
installed with Word, perhaps that needs checking.
   post.tree() (I think) produces postscript rather than eps, but the 
solution might turn out to be as simple.

6. Word has no problem with .ps files, and we use them all the time.
Maybe you or your computer or printer does, in which can you can convert
.ps using GhostScript

Comment: I am trying to teach my Word to insert .ps or .eps files, it cannot
do it at the moment but I am not loosing hope.


THANKS TO ALL !

Leonid Gibiansky

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>
  • [S] plot.tree question, Gibiansky, Leonid <=