renv blog

More on reproducibility…
Author

AR

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 depepndencies or explicilty 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! The first test in 1c did not work, but after adding the renv folder it did work.

Write a blog post addressing the following questions:

  1. What is the idea of the renv package?

The renv package is a good way to manage your local R library. It helps to make projects more reporducible by saving your project when you specify. From my understanding you load renv, work in your project as normal, and then you’re ready, you save it. Unlike regular saving it saves information like packages used and paths.

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

For blog 4, I did not have any issues (at least so far). I was easily able to install the package and use it. Where I ran into issues was when we created a test r package in class. I was not able to build my package. When I googled my error, I found that the issue was that I had installed renv to my regular library and not the specific project library which was causing problems. After I deleted it, I was able to build the test package.