README.md

R Package Template (rpkgtemplate)

A template for simple github-hosted packages

This package is largely inspired by the R package primer written par Karl Broman.

Objective

The objective of this repository is to act as a simple, clonable R package template to aid in development.

Prerequisites

Usage

  1. Clone the repository
# You can either use git clone https://github.com/olichose123/rpkgtemplate.git
# # or download the template from GitHub
  1. Modify the DESCRIPTION file to change the package's information

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
  1. Modify or delete README.md (it contains this text, and you want it to contain your package's information)

TODO: make an alternative readme file with prewritten sections

  1. Document and validate the package
# 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
  1. Create a new empty GitHub repository (usually with no .gitignore and no README.md)

  2. 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!

Notes

Installing this package

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!

Code documentation

TODO

To do



olichose123/rpkgtemplate documentation built on June 20, 2019, 4:13 a.m.