ETC5513: Collaborative and Reproducible Practices
Tutorial 10
🎯 Objectives
- Learn to use
git lfs
to deal with large files - Create licenses in our repostiroies
- Use
renv
to create a local library
Setting up licensed repositories
For this week’s tutorial, you’ll need a brand new repository to work in. It can be public or private.
Create a new repository with your choice of name. Ensure that it has a license, a
.gitignore
file and aREADME
file.
You should select these from the repo creation menu, not by committing them yourself later.Clone the repository to your local machine
Change the license file to a different one. Remember you can find licenses on choosealicense.com. Stage, commit and push your changes.
Revert the commit you just made.
- Reset the last two commits. You should end up with your original license file back on the repo.
- Commit, stage and push your changes (if there are any). What do you notice?
Edit the
README.md
file to include your name. Stage and commit (but don’t push).Amend the most recent commit to also include the course code and the tutorial number. Include an expanded commit message for the amended commit.
- Push your changes. Can you see the expanded commit message on GitHub?
Lightweight dependency management using renv
Inside your repo from the previous section:
Create a qmd file that has a libraries code chunk, and load the
dplyr
andggplot2
libraries.Stage the changes, commit and push.
What are the library paths for this project?
Install the
renv
packageInitialise
renv
in your R seession
- What new files or folders have been made in your repo with this command?
Using the terminal, use
cd
andls
to find the new files.In the terminal, check the status of your repo.
Create a snapshot of your repostiory using
renv::snapshot()
Check the status of your repo, stage, commit and push the changes into the remote repository.
Extension: Try adding a development package from GitHub, such as the naniar
package. Follow the renv
workflow. Does the package get recorded? Can you see it in the lockfile? How is it recorded differently from packages on CRAN?