[R] Tinn-R pdf()

Bert Gunter gunter.berton at gene.com
Wed Apr 8 20:56:20 CEST 2009


I **think** the explanation is:

When sending code to R through TINN-R, TINN-R **sources** the code into R.
Sourced code is **not** autoprinted. Indeed, ?source explicitly tells you
this.

-- Bert 


Bert Gunter
Genentech Nonclinical Biostatistics
650-467-7374

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of Deepayan Sarkar
Sent: Wednesday, April 08, 2009 9:20 AM
To: Tobias Verbeke
Cc: r-help at r-project.org; ONKELINX, Thierry
Subject: Re: [R] Tinn-R pdf()

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
> > > --

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list