ResBazAZ 2023
You find yourself copying and pasting code from one project to another
You have data set you want to document and share
Your R code will be helpful for others doing similar analyses and you want to share
DESCRIPTION
Metadata
Dependencies & requirements
R code (functions)
Data
Documentation
In the workshop today we will:
R Packages (2e) goes into more detail on just about everything we’ll cover today and more!
Short, no spaces hyphens or underscores
Should reflect what the package does to some extent
Shouldn’t be the name of an already existing package
There are several ways to go about making a new R package that can be shared. We’re going to go with the “GitHub first” method today:
We will be using git and GitHub in this workshop in it’s simplest ways
Git is a “version control” software that will let you track changes to files and “push” those changes to GitHub
GitHub is a website for hosting code “repositories” and it will be how people can find and install our R package
devtools
is a “meta package” kind of like tidyverse
here
will only be used during the setup process for this workshop
Check that RStudio knows where git is on your computer. Go to Tools > Global Options… and select the Git/SVN option.
Make sure the checkbox is checked and there is something in the “Git executable” box
If there is nothing in the git executable box, it is possible you need to install git on your system:
In terminal:
Download the installer here: https://git-scm.com/download/win