-
Notifications
You must be signed in to change notification settings - Fork 82
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
Should we offer a way to pin an R version for Positron, in a workspace? #2659
Comments
A good criterion for the selection procedure is one that is very easy to understand and predict. For the reasons you mentioned, the current approach of remembering implicitly the last launched version can be both surprising and hard to predict. One way of making the selection more transparent would be to always use a generic selection procedure unless a different version has been explicitly pinned by the user. This could be via renv, but I'd also love a "pin to workspace" button in the runtime dropdown list. The visible pin would make it easy to understand that the default selection has been overridden. Maybe the workspace pin should be grayed out to indicate that the version is managed by renv, pyenv, or similar? Regarding the default selection it could be one of these:
I think this last approach might work best overall. |
Just adding the idea from #3946 here with a few modifications: In VS Code, it's possible to set the R installation to use for the workspace in .vscode/settings.json, e.g. this current setup that works nicely: {
"r.bracketedPaste": true,
"r.plot.useHttpgd": true,
"r.rpath.mac": "${workspaceFolder}/.pixi/envs/default/bin/R",
"r.rterm.mac": "${workspaceFolder}/.pixi/envs/default/bin/radian",
"r.rpath.linux": "${workspaceFolder}/.pixi/envs/default/bin/R",
"r.rterm.linux": "${workspaceFolder}/.pixi/envs/default/bin/radian",
"r.rpath.windows": "${workspaceFolder}/.pixi/envs/default/bin/R",
"r.rterm.windows": "${workspaceFolder}/.pixi/envs/default/bin/radian"
} Since Positron doesn't use the R extension, but your own - it currently doesn't work, but it would be a great way to handle it and it's already supported for VS Code, it would allow users who use this option to seamlessly transfer to Positron with only a few modifications. Alternatively, having a separate file that contains the R version, but that would mostly make sense if other IDEs (e.g. RStudio) could also read it. Then This workflow means that whenever the workspace is opened, it automatically detects and chooses the R installation to use - e.g. in this template the user chooses their R version which is then installed from from conda-forge ( Maybe a prioritised approach could look like this:
|
In python you can already select an interpreter, eg from a conda env. It would be GREAT to be able to choose the R version in a given conda env as well |
Related to #2235. |
This notion is floating around in some issue comments and in live chats, so I want to record it for proper discussion.
Between the advent of rig (https://github.com/r-lib/rig) and Positron's interpreter drop-down, I feel like more R users are going to be living with multiple versions of R on their machine in the near future. The R world does not have the same culture of using environments as, say, Python and this is largely with good reason. Briefly, I think typical R user behaviour (using the same package library for most/all projects) is reasonable behaviour in lots of cases, due to CRAN's attention to reverse dependency breakage.
This brings up new questions about how to decide which version of R to fire up in a particular workspace.
Dumping some thoughts here:
R_LIBS_USER
env var as described, e.g. in rstats.wtf. I know rig tries to nudge people to keep minor-version-specific user libraries, but it's entirely possible that Positron should also help people fall into this Pit of Success.The text was updated successfully, but these errors were encountered: