[R] Tinn-R pdf()

Deepayan Sarkar deepayan.sarkar at gmail.com
Wed Apr 8 18:20:16 CEST 2009


On 4/8/09, Tobias Verbeke <tobias.verbeke at openanalytics.be> wrote:
> Hi Henning,
>
>
> > thanks for your help, with solved the problem, although i don't why,
> because when using the R editor accessible via the R console i created many
> many lattice plots with the code i posted, i.e. without the print() command.
> >
>
>  At the command line, R objects (including lattice plots which are
>  objects) get auto-printed, i.e. the print method is invoked automatically
> on these objects.
>
>  This is not the case when you write to a pdf file.

That claim is not accurate. Auto-printing should not be affected by
whether a pdf device is open at the moment.

I'm not familiar with TINN-R, but it's possible it executes R commands
through some sort of wrapper function, and that is failing to emulate
auto-printing correctly.

-Deepayan

>
>  Best,
>  Tobias
>
>
>
> >
> > > -------- Original-Nachricht --------
> > > Datum: Wed, 8 Apr 2009 12:29:58 +0200
> > > Von: "ONKELINX, Thierry" <Thierry.ONKELINX at inbo.be>
> > > An: "Henning Wildhagen" <HWildhagen at gmx.de>, r-help at r-project.org
> > > Betreff: RE: [R] Tinn-R pdf()
> > >
> > >            Dear Henning,
> > >
> > > You need to print() lattice plots when using a device:
> > >  library(lattice)
> > >
> > > pdf("plot1.pdf")
> > > PLOT<-(xyplot, ...)
> > > print(PLOT)
> > > dev.off()
> > >
> > > So this is not due to TINN-R.
> > >
> > > HTH,
> > >
> > > Thierry
> > >
> > >
> ------------------------------------------------------------------------
> > > ----
> > > ir. Thierry Onkelinx
> > > Instituut voor natuur- en bosonderzoek / Research Institute for Nature
> > > and Forest
> > > Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
> > > methodology and quality assurance
> > > Gaverstraat 4
> > > 9500 Geraardsbergen
> > > Belgium tel. + 32 54/436 185
> > > Thierry.Onkelinx at inbo.be www.inbo.be
> > > To call in the statistician after the experiment is done may be no more
> > > than asking him to perform a post-mortem examination: he may be able to
> > > say what the experiment died of.
> > > ~ Sir Ronald Aylmer Fisher
> > >
> > > The plural of anecdote is not data.
> > > ~ Roger Brinner
> > >
> > > The combination of some data and an aching desire for an answer does not
> > > ensure that a reasonable answer can be extracted from a given body of
> > > data.
> > > ~ John Tukey
> > >
> > > -----Oorspronkelijk bericht-----
> > > Van: r-help-bounces at r-project.org
> [mailto:r-help-bounces at r-project.org]
> > > Namens Henning Wildhagen
> > > Verzonden: woensdag 8 april 2009 11:25
> > > Aan: r-help at r-project.org
> > > Onderwerp: [R] Tinn-R pdf()
> > >
> > > Dear R and Tinn-R users,
> > >
> > > i recently switched to Tinn-R and sending code to R works fine (R 2.8.1,
> > >
> > > Tinn-R 2.2.0.2, OS Windows XP). However, i encountered a problem when
> trying to send plots to pdf files like this:
> > >
> > > library(lattice)
> > >
> > > pdf("plot1.pdf")
> > > PLOT<-(xyplot, ...)
> > > PLOT
> > > dev.off()
> > >
> > > The file "plot1.pdf" is created, but it is empty.
> > > If i paste the code above directly into the R console and run it, the
> > > file "plot1.pdf" is created and in this case contains "PLOT".
> > >
> > > I guess that some settings in Tinn-R are wrong, but i have no idea
> > > which. Maybe someone has a suggestion?
> > >
> > > Thanks,
> > >
> > > Henning
> > > --




More information about the R-help mailing list