Skip to content
Prev 3464 / 3656 Next

why is KEYWORDS.db not in '/usr/lib/R/doc/' but in '/usr/share/R/doc/'?

Hello Johan and welcome to R-SIG-Debian!

? Tue, 6 Jun 2023 18:55:27 +0200
Johan Andresen <johan.andresen at gmail.com> ?????:
It seems that R.home('doc') doesn't return the right path when running
from under rpy2 for some reason. (With Debian packages, it should
return "/usr/share/R/doc", not "/usr/lib/R/doc".)

It's documented in ?R.home that on Unix-like OSes, the function relies
on environment variables like R_DOC_DIR being set during startup.

How does rpy2 launch R? It looks like rpy2 drives an embedded R like a
frontend. I think that at least under Unix-alikes, the required
environment variables are set by launching the frontend via `R CMD
/path/to/frontend/executable` (see WRE 8.1 [*]), except this isn't
convenient for the Python process. I guess rpy2 could obtain the
additional variables the same way it currently extracts LD_LIBRARY_PATH.
One tiny detail: this mailing list (and other R project mailing lists)
removes the HTML part of the messages it processes, so it's best to
compose in plain text. But the rest of it you're doing absolutely right!