[R] Party plots

Nordlund, Dan (DSHS/RDA) NordlDJ at dshs.wa.gov
Thu Sep 3 23:18:35 CEST 2009


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
> Behalf Of AnnieE
> Sent: Thursday, September 03, 2009 12:57 PM
> To: r-help at r-project.org
> Subject: Re: [R] Party plots
> 
> 
> 
> 
> Achim Zeileis wrote:
> >
> >
> >>>You can easily plot into a large PDF, e.g., something like this
> >
> >>>   pdf(file = "foo.pdf", height = 15, width = 20)
> >>>   plot(foo)
> >>>   dev.off()
> >
> >>>and then view the PDF in an external viewer, zooming into parts of a tree
> >>>etc. Depending on the size of the tree in "foo", you might have to adjust
> >>>height/width accordingly.
> >
> >
> 
> Thanks very much.  That sounds like just what I'm looking for and have been
> unable to ferret out in my search through manuals and forums.  I'm still a
> bit stuck though, because of my unfamiliarity with pulling stuff in and out
> of R.
> 
> How do you get the initial .pdf file that you're manipulating here?  I tried
> saving the R graphic to a PDF on my desktop and then running
> 
>      pdf (file = C:/Documents and Settings/aelmore/Desktop/foo.pdf, height =
> 15, width = 20)
>      plot (foo)
>      dev.off()

You need to put the filename in quotes

file = "C:/Documents and Settings/aelmore/Desktop/foo.pdf"

Hope this is helpful,

Dan

> 
> but that netted me the error:  unexpected '/' in "pdf(file = C:/
> and of course trying it without the string returned the error:  object "foo"
> not found.
> 
> What am I missing?  Is the graphic that R displays when I call for a plot
> somehow available for use here?  If so, I don't know what it's called/how to
> access it.  The name of the regression tree that it represents doesn't work.
> That attempt gave me the error: cannot coerce type 'S4' to vector of type
> 'character.'
> 
> So, as you see, closer but still stuck.
> 
> Thanks again in advance for any assistance.
> 
> 


Daniel J. Nordlund
Washington State Department of Social and Health Services
Planning, Performance, and Accountability
Research and Data Analysis Division
Olympia, WA  98504-5204




More information about the R-help mailing list