[R] Slow printing in batch?

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Nov 22 09:15:45 CET 2001


On Wed, 21 Nov 2001, BXC (Bendix Carstensen) wrote:

> For doumentation purposes I run a batch R program that does reshaping etc.
> of data and finally prints things.
>
> When I paste the code into an R-window everything runs in a few seconds,
> but in Batch mode i get in the output file the result below.
>
> Any clues why R uses 4 min to print a 1129\times 6 dataframe in batch mode?
> The scrit I use to run R is:
>
> c:\stat\r\%R_VERS%\bin\Rterm --no-restore --no-save -q < %1.R > %1.Rl
>
> and in the .Rl file i get:

That's not printing, as I see it, but writing to a file.  Try proc.time.
It looks like it is slow writing to your disk: is it fragmented?

I have no problem with much larger ouput to files.

> ....
> > Sys.time()
> [1] "2001-11-21 16:00:23 Romance Standard Time"
> >
> > summary( hbl )
>        sample     lab             dev             cal           day
> HbA1c%
>  0289 3962: 50   SDC:1055   nyTosoh :470   BioRad   :135   Min.   :1.0
> Min.   : 4.700
>  0308 5530: 25   AAS:  74   Tosoh   : 74   DEKS-0521:577   1st Qu.:6.0   1st
> Qu.: 7.300
>  0303 9481: 25              V2BioRad:450   DEKS-1321:276   Median :7.0
> Median : 8.200
>  0303 8453: 25              VCBioRad:135   Tosoh    :141   Mean   :6.8
> Mean   : 8.583
>  0299 7761: 25                                             3rd Qu.:8.0   3rd
> Qu.:10.000
>  0294 7744: 25                                             Max.   :9.0
> Max.   :13.700
>  (Other)  :954
>
> >
> > Sys.time()
> [1] "2001-11-21 16:00:27 Romance Standard Time"
> >
> > hbl
>          sample lab      dev       cal day HbA1c%
> 1     0294 7744 SDC VCBioRad DEKS-0521   6    7.9
> 2     0294 7744 SDC VCBioRad DEKS-0521   7    7.8
> 3     0294 7744 SDC VCBioRad DEKS-0521   8    7.7
> 4     0294 7744 SDC V2BioRad    BioRad   6    8.0
> (deleted lines)
> 1171      10322 SDC  nyTosoh DEKS-1321   6   10.7
> 1172      10322 SDC  nyTosoh DEKS-1321   7   10.7
> 1173      10322 SDC  nyTosoh DEKS-1321   8   10.7
> >
> > Sys.time()
> [1] "2001-11-21 16:04:41 Romance Standard Time"
>
>
> I use:
>          _
> platform i386-pc-mingw32
> arch     x86
> os       Win32
> system   x86, Win32
> status
> major    1
> minor    3.1
> year     2001
> month    08
> day      31
> language R
>
> ----------------------
> Bendix Carstensen
> Senior Statistician
> Steno Diabetes Centre
> Niels Steensens Vej 2
> DK-2820 Gentofte
> Denmark
> tel: +45 44 43 87 38
> mob: +45 28 25 87 38
> fax: +45 44 43 73 13
> bxc at novonordisk.com
> www.biostat.ku.dk/~bxc
> ----------------------
>
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list