
Before we actually add/commit them to the local git repository we need to enter a comment. Now check the files/folders you want to include in the git repository – obviously we need everything necessary for the package, so I checked the `DESCRIPTION’ and `NAMESPACE’ files, and the `R’ and `man’ folders. Yellow indicates that, so far, none of these have been added to git. This does not have to be all the files and folders we keep in our R package directory we must decide what we would like to include in (or `commit’ to) the git repository, and ultimately share with the world. Click on the `commit’ button (circled) and in the box that opens, on the left you will see all the files/folders present in the local R package directory. They contain a record of the files and folders you want associated with the git project. This consists of a collection of invisible by default (they start with a `.’) files in the same directory as the R package we just created. Whenever this `project’ is loaded in RStudio, you will see that the top right panel has a `git’ tab – click on it and you will see something like:īefore going further, it’s worth briefly explaining the concept of your `local git repository’. Now we have an R package, with git set up locally. Be sure to tick the checkbox for `Create a git hub repository for this project’: Now enter a name and add any R functions you want to kick the package off.

Rstudio github how to#
Now, here is how to set up an R package for development in R studio, and sharing via GitHub.Ĭlick File -> New project… -> Create project from: `New Directory’ -> Project Type: `R package’. See this excellent LifeHacker tutorial for how to set up Git (and GitHub), and an expanded `beginner’s’ explanation of what they are. Hence why I have written this post – to serve as notes to self for future R packages. The rest of this post assumes that However, largely due to my inexpertise with git, I always find the initial set up a bit fiddly, and sensitive to the order in which things are done. Rstudio does an excellent job of enabling development of R packages with git, and syncing changes to github.
Rstudio github update#
your collaborators) – you don’t need to email them the package every time you update it, just let them know to re-install from github.

Therefore github provides an excellent way to share your package with it’s users (e.g.

Rstudio github install#
