renv package

More on reproducibility…
Author

Yingchao Zhou

Published

March 2, 2023

Frontmatter check Render rmarkdown

What happens when we change the Rmd file and commit?

In Blog 5 you had the first exposure to Github Actions. We just checked frontmatter compliance (as we do for this round). You see that we have added a second action - here, we are converting the Rmarkdown document to a markdown file by running render_rmarkdown on Github. This action passes successfully for this document. We want to do something similar for blog #4.

Now start reading …

Read the vignette Introduction to renv for the renv R package by Kevin Ushey.

Then do:

  1. Install the R package renv on your local machine.

  2. In the project for blog 4, initialize the workflow used by the renv package.

  3. Add all dependencies to the environment (implicitly by installing all the dependencies or explicitly by listing dependencies in a DESCRIPTION file).

  4. Add the renv folder to your blog 4 repository, and push the changes.

  5. Is the github action working? Read any potential error messages in the workflow and try to fix things. Make sure to check stackoverflow for help, don’t forget our Discussion board!

Write a blog post addressing the following questions:

  1. What is the idea of the renv package?

renv packages is for managing the dependencies of a project. By using it we can easily save the R version and dependent packages version and restore the environment in the future. This helps with reproducibility of the project.

  1. In 50 to 100 words describe your experience working with renv. What went well? What did not go so well?

I tested 8 rounds to get things right. In the render-rmarkdown.yaml generated by usethis package, setup-r, setup-renv and setup-pandoc are in v1, and I get error which says fail to install R as well as other warnings. After I updated these to v2, I started getting error saying there is no package called rmarkdown, which turned out to be caused by not pushing renv.lock to my repo.

Submit this blog post to your blog-6 repo.