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

Customize R binary #89

Open
rickhelmus opened this issue Nov 25, 2018 · 5 comments
Open

Customize R binary #89

rickhelmus opened this issue Nov 25, 2018 · 5 comments
Labels
feature a feature request or enhancement

Comments

@rickhelmus
Copy link

Hello,

At the moment it doesn't seem to be possible to run a different installed R version (i.e. override the binary path). This might come in handy for a package I'm using which doesn't work with the latest R (yet).

Thanks,
Rick

@gaborcsardi
Copy link
Member

Can you always pass RData files between different R versions?

Anyway, if you want to run another R version, you can always use processx::run()
or processx::process directly.

@gaborcsardi gaborcsardi added the feature a feature request or enhancement label Nov 27, 2019
@cybaea
Copy link

cybaea commented Jan 22, 2021

Can you always pass RData files between different R versions?

Anyway, if you want to run another R version, you can always use processx::run()
or processx::process directly.

Perhaps, but I like the 'callr' interface and there is no documentation on how to use it with a processx object.

Could we not simply add bin= to the r_process_options() and prefer this value to R.home("bin")?
(Will probably need to seyt .libPaths too...)

@gaborcsardi
Copy link
Member

I think it might be better to have a new r_version() function, which runs the selected version.

@gaborcsardi
Copy link
Member

With the fix of #95, much of this already works. However the library path setup still needs work, we probably need to unset some env vars like R_HOME, and determine the version of RDS we can use. Plus we would need a proper API for it, instead of specifying the executable directly.

❯ r(function() getRversion(), arch = "/Library/Frameworks/R.framework/Versions/3.5/Resources/bin/R")
[1] ‘3.5.3’

❯ r(function() getRversion(), arch = "/Library/Frameworks/R.framework/Versions/3.4/Resources/bin/R")
Error: callr subprocess failed: cannot read workspace version 3 written by R 4.0.4; need R 3.5.0 or newer
Type .Last.error.trace to see where the error occured

❯ r(function() getRversion(), arch = "/Library/Frameworks/R.framework/Versions/3.6/Resources/bin/R")
Error in get_result(output = out, options) :
  callr subprocess failed: could not start R, exited with non-zero status, has crashed or was killed
Type .Last.error.trace to see where the error occured.Last.error$stdout
[1] "WARNING: ignoring environment value of R_HOME\n"

@OfekShilon
Copy link

Personally I think version=2 in all saveRDS calls is definitely good enough. It supports all R versions >=1.4, AFAIK without any loss of functionality.
Regarding API: specifying executable+libpath directly seems unavoidable, but probably better to set defaults in some setup call and not in every r call.

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

No branches or pull requests

4 participants