Sebastian Meyer
2021-Oct-20 07:31 UTC
[Rd] Environment setting _R_CHECK_DEPENDS_ONLY_='true'
(this should have been posted to R-package-devel, not R-devel) Am 20.10.21 um 00:17 schrieb John Maindonald via R-devel:> Setting > Sys,setenv('_R_CHECK_DEPENDS_ONLY_'=?true?) > or Sys,setenv('_R_CHECK_DEPENDS_ONLY_?=TRUE) > > (either appear to be acceptable) appears to have no effect when I do, e.g.If you set the environment variable inside a running R process, it will only affect that process and child processes, but not an independent R process launched from a shell like you seem to be doing here:> > $R CMD check qra_0.2.4.tar.gz > * using log directory ?/Users/johnm1/pkgs/qra.Rcheck? > * using R version 4.1.1 (2021-08-10) > * using platform: x86_64-apple-darwin17.0 (64-bit) > * using session charset: UTF-8 > . . . > > (This should have failed.)How to set environment variables is system-specific. On a Unix-like system, you could use the command _R_CHECK_DEPENDS_ONLY_=true R CMD check qra_0.2.4.tar.gz to set the environment variable for this R process. See, e.g., https://en.wikipedia.org/wiki/Environment_variable. Best regards, Sebastian Meyer> > I?d have expected that the "On most systems . . .? mentioned in the Writing R extensions > manual (1.1.3.1 Suggested packages) would include my setup. > > Any insight on what I am missing will be welcome. > > John Maindonald email: john.maindonald at anu.edu.au > > > > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >
Dirk Eddelbuettel
2021-Oct-20 13:31 UTC
[Rd] Environment setting _R_CHECK_DEPENDS_ONLY_='true'
On 20 October 2021 at 09:31, Sebastian Meyer wrote: | If you set the environment variable inside a running R process, it will | only affect that process and child processes, but not an independent R | process launched from a shell like you seem to be doing here: Yes. That is somewhat common, if obscure, knowledge by those bitten before. Maybe a line or two could be / should be added to the docs to that effect? | How to set environment variables is system-specific. On a Unix-like | system, you could use the command | | _R_CHECK_DEPENDS_ONLY_=true R CMD check qra_0.2.4.tar.gz | | to set the environment variable for this R process. | See, e.g., https://en.wikipedia.org/wiki/Environment_variable. R does have hooks for this, I had these for a few years now: ~/.R/check.Renviron ~/.R/check.Renviron-Rdevel Again, might be worthwhile documenting it in the Inst+Admin manual (if it isn' already, I don't recall right now). Dirk -- https://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org