A template for simple github-hosted packages
This package is largely inspired by the R package primer written par Karl Broman.
The objective of this repository is to act as a simple, clonable R package template to aid in development.
install.packages("devtools")
install.packages("roxygen2")
# You can either use git clone https://github.com/olichose123/rpkgtemplate.git
# # or download the template from GitHub
visit this website for more info
Package: rpkgtemplate # Change this
Version: 0.1 # Change this
Title: pkg_full_name # Change this
Description: pgk_full_desc # Change this
License: GPL-3 # Change this if necessary
Author: me <me@me.com> # Change this
Maintainer: me <me@me.com> # Change this
Depends: R(>=3.4.0) # Change this if you know what you're doing
Optionally, you can add package dependencies:
Imports:
packageA
packageB
Suggests:
packageC
packageD
TODO: make an alternative readme file with prewritten sections
# start R inside your package (or with your package's folder as the working directory)
# import devtools
library(devtools)
# automatically document the package by executing this function
document()
# validate if your package is functionnal by executing this function
check()
# Act on warnings and errors raised by "check()"'s result
Create a new empty GitHub repository (usually with no .gitignore and no README.md)
Push you new package to the new GitHub repository
# start by noting and copying the github link by clicking on the green "clone or download" button
# Then execute the following calls:
git init
git add .
git commit -m "first commit"
git remote add origin github_git_url
git remote -v
git push -u origin master
# That's it!
There is no actual reason you'd want to actually install rpkgtemplate to your R library, but is does serve as a good example of installing packages through GitHub.
# Load devtools
library(devtools)
# install this package
install_github('olichose123/rpgktemplate', force = T)
# Note that the 'force' parameter is optional, unless you want to actually reinstall a newer
version of the same pacakge
# test the installation
validate_package() # This should simply return TRUE!
TODO
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.