[R-sig-Debian] pkg/tests: how to run them with --vanilla

Dirk Eddelbuettel edd at debian.org
Sat Jul 3 23:13:24 CEST 2010


On 3 July 2010 at 11:07, mat wrote:
| Hello
| 
| I recently submitted an update of a package, and received error reports 
| from CRAN maintainers concerning the pkg/tests section:
| 
| > Next time you update, can you please ensure that the .Rout.save files 
| > are generated in English (with LANGUAGE=en set).  R 2.12.x will ensure 
| > that the tests are run in English, and it saves a lot of unnecessary 
| > chatter if the reference results also are.
| >
| > As a further point,
| >
| >> [Sauvegarde de la session précédente restaurée]
| >
| > indicates that they were not generated in a vanilla session, and they 
| > should be (as the tests are run with --vanilla --slave).
| >
| > Brian Ripley 
|   I always used to run the .Rout.save files with R CMD BATCH xxx.R So it 
| seems I should rather do it with R --vanilla... I tried:
| cat xxx.R| R --vanilla --slave > xxx.Rout.save

See 'R CMD BATCH --help' --- you can pass further options along:

edd at ron:/tmp$ echo "cat(4)" > foo.R
edd at ron:/tmp$ R CMD BATCH --vanilla --slave /tmp/foo.R
edd at ron:/tmp$ cat foo.Rout 
4> proc.time()
   user  system elapsed 
  0.352   0.036   0.373 
edd at ron:/tmp$ R CMD BATCH --vanilla /tmp/foo.R
edd at ron:/tmp$ cat foo.Rout 

R version 2.11.1 (2010-05-31)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> cat(4)
4> 
> proc.time()
   user  system elapsed 
   0.34    0.04    0.38 
edd at ron:/tmp$ 

| But this gives files without the ">", and then it gets reported in the R 
| CMD check... What would be the good way to do?
| 
| Secondly, I always got this error that the R CMD BATCH run in french, 
| but the R CMD check in english. I have been told I should change to 
| language=EN. But how do I do this in Linux? I just added:
| Sys.setlocale("LC_ALL","en_US.UTF8")
| Sys.setlocale("LC_CTYPE","en_US.UTF8")
| Sys.setlocale("LC_MESSAGES","en_US.UTF8")
| 
| in the .Rprofile... it this right?

Defaults work for me, so I never changed them. Sorry.

-- 
  Regards, Dirk



More information about the R-SIG-Debian mailing list