[Rd] Environment setting _R_CHECK_DEPENDS_ONLY_='true'

John Maindonald john@m@|ndon@|d @end|ng |rom @nu@edu@@u
Sat Oct 23 22:14:31 CEST 2021


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.maindonald using anu.edu.au<mailto:john.maindonald using anu.edu.au>


On 21/10/2021, at 02:31, Dirk Eddelbuettel <edd using debian.org<mailto:edd using 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 | edd using debian.org<mailto:edd using debian.org>


	[[alternative HTML version deleted]]



More information about the R-devel mailing list