Last active
August 29, 2015 14:20
-
-
Save steadyfish/8ff00ebf3a2e9358907b to your computer and use it in GitHub Desktop.
Creating R packages using RStudio, Git and GitHub
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This method helps creating the proper R package directory structure using RStudio and then syncs it with the corresponding GitHub Project. | |
Sources: | |
http://www.molecularecologist.com/2013/11/using-github-with-r-and-rstudio/ | |
https://support.rstudio.com/hc/en-us/articles/200532077-Version-Control-with-Git-and-SVN | |
http://r-pkgs.had.co.nz/git.html | |
Setup a GitHub account. | |
Download and install Rstudio. | |
Download and install the platform-specific version of Git (not GitHub), default options work well. | |
Configure Git with global commands. I have found this step necessary both times I ran through this process. Open up the bash version of Git and type the following: | |
git config –global user.name “your GitHub account name” | |
git config –global user.email “[email protected]” | |
Open Rstudio and set the path to Git executable. Go to Tools > Options > Git/SVN | |
Create a new R package from RStudio | |
Create a README file in the project/package directory. | |
Commit at least once. | |
Create a new project on GitHub. | |
Run following commands - | |
git remote add origin https://github.com/<GitHub user name>/<Project or package name> | |
git push -u origin master | |
From now on for usual Commit/Push functions Rstudio GUI commands can be used. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment