In this brief set of exercises, you will try some simple solutions for dependency management in R. For this, you should continue working with the R script you have created and pushed to your GitHub repository in the previous sessions.

Exercise 1

First, add get some information about the version of R you are using as well as the names and versions of the R packages you have loaded in your current R session. Add a comment containing the version of R you are using to the R script you have created and edited in the previous sessions.
You can, of course, get the information about your R version and the packages via the GUI of RStudio (e.g., in the Console and the Packages tab). However, you should should use base R functions to get this information.

Exercise 2

Now, use the groundhog package to load the packages you use in your script.
Do not forget to specify a date. You can just use today’s date.

If you are done with these exercises very quickly or if they are too easy for you, feel free to change some of the arguments for the groundhog.library() function and see what happens. You can also try to use the groundhog package to install a package that is not available on CRAN anymore. Or read some of the detailed documentation on the groundhog package website.