[Rd] Environment setting _R_CHECK_DEPENDS_ONLY_='true'

2021-10-19 Thread 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.

$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.)

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.maindon...@anu.edu.au




__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Environment setting _R_CHECK_DEPENDS_ONLY_='true'

2021-10-23 Thread John Maindonald via R-devel
A footnote, following an off-list exchange with Prof Ripley, is that I needed
needed to have Suggested or other additional packages installed somewhere
other than .Library .

"The following variables control checks for undeclared/unconditional use of 
other packages. They work by setting up a temporary library directory and 
setting .libPaths() to just that and .Library, so are only effective if 
additional packages are installed somewhere other than .Library.”
[I am not sure of the source of this quote.]

If vignettes make extensive use of Suggested packages,
then exiting early from vignettes when access would otherwise be required to
Suggested package [under knitr, one can use knitr::knit_exit()]  can be an
alternative to leaving out checking of vignettes in order to speed up initial
testing.

On MacOS Mojave with a bash shell
  env _R_CHECK_DEPENDS_ONLY_=true  R CMD check qra_0.2.4.tar.gz
works like a charm.  Some other Unix systems will omit the ‘='


John Maindonald email: 
john.maindon...@anu.edu.au


On 21/10/2021, at 02:31, Dirk Eddelbuettel 
mailto:e...@debian.org>> wrote:


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://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FEnvironment_variable&data=04%7C01%7Cjohn.maindonald%40anu.edu.au%7Cb519af02f1df454df49208d993cdea27%7Ce37d725cab5c46249ae5f0533e486437%7C0%7C0%7C637703335008269211%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=aCCVvvnWQaRxtzxuUJ5lDKcPfMU2BzCJnDRC%2BTa4TnI%3D&reserved=0.

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://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdirk.eddelbuettel.com%2F&data=04%7C01%7Cjohn.maindonald%40anu.edu.au%7Cb519af02f1df454df49208d993cdea27%7Ce37d725cab5c46249ae5f0533e486437%7C0%7C0%7C637703335008269211%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=5MTPe0%2Ftqou%2B0DI8%2F7C4NYtM3tJCb4Vpwbe4klWiTco%3D&reserved=0
 | @eddelbuettel | e...@debian.org


[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel