Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run rcmdcheck on a different version of R #226

Open
MichaelChirico opened this issue Aug 18, 2024 · 1 comment
Open

Can't run rcmdcheck on a different version of R #226

MichaelChirico opened this issue Aug 18, 2024 · 1 comment

Comments

@MichaelChirico
Copy link
Contributor

rcmdcheck() appears to always take the version of R from the calling session, with no way to override this by setting R_HOME:

system("/usr/local/bin/Rscript -e 'rcmdcheck::rcmdcheck(...)'")
# ─  using R version 4.4.0 (2024-04-24)
system("/usr/local/bin/Rscript -e 'rcmdcheck::rcmdcheck(..., env=c(R_HOME=\"/path/to/rdevel\")'")
#    WARNING: ignoring environment value of R_HOME
# ─  using R version 4.4.0 (2024-04-24)

system("/path/to/rdevel/bin/Rscript -e 'rcmdcheck::rcmdcheck(...)'")
# ─  using R Under development (unstable) (2024-08-16 r87026)
system("/path/to/rdevel/bin/Rscript -e 'rcmdcheck::rcmdcheck(..., env=c(R_HOME=\"/usr/local\")'")
#    WARNING: ignoring environment value of R_HOME
# ─  using R Under development (unstable) (2024-08-16 r87026)

Am I perhaps doing something wrong? I can of course call rcmdcheck() in a subprocess, but it would be nice to easily write res <- rcmdcheck(...); process(res) in the current session (without needing {callr}).

@gaborcsardi
Copy link
Member

Indeed, rcmdcheck runs R CMD check in the same R version, by design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants