-
Notifications
You must be signed in to change notification settings - Fork 81
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
Option to generate an renv lockfile to go with a reprex #313
Comments
Interesting idea! cc @kevinushey |
This sounds like it could be useful. Do we want the lockfile to capture all of the packages in the user's library, or only the ones actually used in the reprex? One downside is that the |
My first thoughts:
Are we likely to miss anything that way? If we have (1), do we need (2)?
Seems like remote lockfiles would accommodate most use cases, but we use proprietary packages in my work environment, and I need to avoid disclosing internal names and URLs. Related: #214. Could we allow both options? |
I've decided I'm not willing to maintain this sort of feature right now. I'm not convinced it will be used intensely enough to justify the addition. As a compromise / workaround, could those who want this craft some sort of code snippet that a user could drop into their reprex, when you really want a lock file, on a ad hoc basis? Then we could have a mini article about it and at least it would be documented in a place easy to point to. |
I can add a function to |
@jennybc: could
|
And I've now updated the development version of
as part of a script that you'd like to include a lockfile for, and the lockfile will be included (as JSON) in the rendered output. |
As of a4e3efe, when any reprex is rendered, you can now do Why does the option have this name? We already had an option named I have already demo'd this with the dev version of renv! I think this it's a pretty interesting mechanism for synergy between reprex and packages that want to generate specific diagnostics or other artefacts on the user's system. Just to link all this up, here's where @kevinushey did what he describes above: rstudio/renv@25be944. Presumably there will be some refinement now that the Here's the reprex source: x <- 1:5
mean(x)
renv::snapshot(reprex = TRUE) And here's what that produces: x <- 1:5
mean(x)
#> [1] 3
renv::snapshot(reprex = TRUE) Lockfile
Lockfile generated by renv 0.12.5-9. Created on 2021-01-15 by the reprex package (v0.3.0.9001) |
When I troubleshoot someone else's bug report, I sometimes need to manually install the users's versions of packages listed in the session info (recent example here). Would it be reasonable for
reprex()
to help automate this process, possibly by supplying anrenv
lockfile inline in a<details>
tag in the output R Markdown?This is somewhat related to #284 except the relevent
reprex
es here are not necessarily powered byrenv
to start.The text was updated successfully, but these errors were encountered: