[R] Help with R

Gavin Simpson gavin.simpson at ucl.ac.uk
Wed Aug 3 01:21:23 CEST 2011


On Thu, 2011-07-28 at 11:58 -0400, Sarah Goslee wrote:
> Hi Mark,
> 
> On Thu, Jul 28, 2011 at 10:44 AM,  <mark at statcourse.com> wrote:
> >
> >   1.  How can I plot the entire tree produced by rpart?
> 
> What does plot() not do that you are expecting?

Not do any labelling... ;-)

text(tree)

where `tree` is your fitted tree will add the labels after using
`plot()` as per Sarah's reply.

> 
> >   2.  How can I submit a vector of values to a tree produced by rpart and have
> >   it make an assignment?
> 
> What does predict() not do that you are expecting?

Indeed.

G

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%



More information about the R-help mailing list