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

Feedback Florian K. #24

Closed
10 tasks done
fkohrt opened this issue Aug 21, 2024 · 6 comments · Fixed by #28
Closed
10 tasks done

Feedback Florian K. #24

fkohrt opened this issue Aug 21, 2024 · 6 comments · Fixed by #28

Comments

@fkohrt
Copy link
Contributor

fkohrt commented Aug 21, 2024

Overall, I found the introduction to renv to be very helpful and understandable! I have created one pull request each for both repos with smaller fixes (mostly typos: #19 and lmu-osc/introduction-to-renv-exercises#3), feel free to accept or reject them. I have also created four issues (#20, #21, #22, #23) before creating this summary issue with all remaining (small) notes. But again, I deem it already a very worthwhile tutorial!

Background

Reproducibility

For example, requesting that someone install Python v3.8.2, R v4.0.3, and a specific version of a package is technically possible, but exceptionally tedious and a poor use of time time.

  • But isn't that what we will be doing? Maybe add "manually" to clearly differentiate.

Technical definitions

By default, R will download packages from CRAN, but you can specify a different repository if you want to download a package from a different location. This is useful if you want to download a package from Bioconductor or GitHub, for example.

  • Is it possible to install a package from GitHub using install.packages()? Maybe rather use r-universe as a second example.

R Package Managers

These are also not managed by package managers, but can easily identified either by checking a package’s DESCRIPTION file or by checking out the Posit Package Manager page for the package.

{renv}

Quick start

File -> New Project -> New Directory -> New Project -> [x] Use renv with this project

  • Maybe format this differently, because on displays with a limited width one has to scroll to read everything.

Caching

In the context of {renv}, the apparent packages in the renv/library folder of your project are actually symlinks that point to the packages in the shared library!

  • Shouldn't it rather say "[...] point to the packages in the cache"? Same for the summary:

Each project has its own library, located in the renv/library folder of the project, but the packages in this folder are actually symlinks to the packages in the shared library.

Exercises > Explicitly Record

  • For me, the order of the steps was a little different here.
  1. Check the status of the dependencies by running renv::status().
    • Is the lock file in-sync with the project library? Why not?

During this step I get "No issues found -- the project is in a consistent state."

Therefore, running renv::restore(), as is suggested next, leads to "The library is already synchronized with the lockfile."

Rendering then fails due to the missing maps package, which I add to the lock file using renv::record("maps"). Only then the renv::restore() installs the missing package.

Also, now I'm warned that the project is out of sync due to the {maps} package that is recorded but seemingly not used. Is it supposed to be warn me? From the documentation I gather that the recommended way is to create a file called _dependencies.R with library() calls.

Optional content > embed() and use()

This is a trade-off that you will need to consider when deciding whether to use renv::embed() or renv::use().

  • Shouldn't this read something like "whether to use renv::embed() or a lockfile"?

Open questions

  • I wondered whether you want to add a few words how install.packages() is altered in a repo which is controlled by renv?

I really liked it when you explained the three columns reported by renv::status() in {renv} > Starting Details > Status and Snapshot > Status.

@fkohrt fkohrt changed the title Individual feedback Feedback Florian K. Aug 21, 2024
@NeuroShepherd
Copy link
Member

Is it possible to install a package from GitHub using install.packages()? Maybe rather use r-universe as a second example.

Yes, packages can be installed from any weblink. The renv::install() function just simplifies this quite a bit.

I wondered whether you want to add a few words how install.packages() is altered in a repo which is controlled by renv?

I think explaining that {renv} shims install.packages() with renv::install() is probably better left unsaid for the tutorial.

@NeuroShepherd
Copy link
Member

Shouldn't this read something like "whether to use renv::embed() or a lockfile"?

Ope, yes this should!

@NeuroShepherd NeuroShepherd linked a pull request Aug 29, 2024 that will close this issue
@NeuroShepherd
Copy link
Member

During this step I get "No issues found -- the project is in a consistent state."

I've corrected this. I originally had the exercise set-up slightly differently, but did not update this text.

Rendering then fails due to the missing maps package, which I add to the lock file using renv::record("maps"). Only then the renv::restore() installs the missing package.

The rendering failure is intentional! I want people to go through precisely these steps.

NeuroShepherd added a commit that referenced this issue Aug 29, 2024
@fkohrt
Copy link
Contributor Author

fkohrt commented Aug 29, 2024

Maybe I missed it, but what was your answer to this?

Also, now I'm warned that the project is out of sync due to the {maps} package that is recorded but seemingly not used. Is it supposed to be warn me? From the documentation I gather that the recommended way is to create a file called _dependencies.R with library() calls.

I'm also asking because I'm interested to hear your thoughts on it.

@NeuroShepherd
Copy link
Member

Maybe I missed it, but what was your answer to this?

Also, now I'm warned that the project is out of sync due to the {maps} package that is recorded but seemingly not used. Is it supposed to be warn me? From the documentation I gather that the recommended way is to create a file called _dependencies.R with library() calls.

I'm also asking because I'm interested to hear your thoughts on it.

I made some relevant edits in the renv-exercises repo which haven't been integrated yet.

I'm indifferent on the creation of a _dependencies.R file. One can accomplish the same thing by just including a library() call at the top of the relevant script.

@fkohrt
Copy link
Contributor Author

fkohrt commented Aug 29, 2024

I made some relevant edits in the renv-exercises repo which haven't been integrated yet.

Ah, I see.

I'm indifferent on the creation of a _dependencies.R file. One can accomplish the same thing by just including a library() call at the top of the relevant script.

Alright, just wondered whether you had in mind an entirely different way of handling this.

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

Successfully merging a pull request may close this issue.

2 participants