Writing an R package is simple. Writing an R package via Github is simple and smart. Github adds all the traditional benefits of version control, in addition to showing off your work and providing and facilitating publication of your package. This tutorial was inspired by a blog post from the beautiful Hillary Parker last year. I used her tut myself, but trying to integrate it with Github leads to some headaches and I felt there were a couple of other small additions to be made.
This has been sitting in my Evernote for some time, so I figured it was about time to upload to my own highly neglected blog, however as a caveate I’ll say that I still need to append more sample code and such, so watch for updates.
Step 0: Load the necessary packages
Step 1: Create your package directory
* Open a .R file to begin writing code
* Open the automatically generated README.md file and edit appropriately
Step 2: Add functions
Step 3: Add minimal documentation
* Utilize roxygen2 by typing create(“packagename”)
* Delete the folder created by roxygen2
Step 4: Add optional, but recommended example and docs
For more detail:http://r-pkgs.had.co.nz/vignettes.html
Step 5: Process your documentation
Step 6: Install your package!