knitr::opts_chunk$set(echo = TRUE)

1) Packages

3 packages are needed to create automaticall short documentation for each function

library(devtools) # Contain function document()
library(roxygen2) # Create automatical documentation

The last package Rtools must be downloading with this link : Package

2) Headings

The template gives an example of the minimal information for each function.

Different sections begin by @something and sections can be in different order except for the first two sections (short resume of function and the explanation of the function)

Tips :
* Start a line

#'
#'\emph{}
#'\string{}
#'\code{}
#'\cr
#'\itemize
#'    @return zoo  
#'    \itemize{  
#'    \item Wet  
#'    \item Normal  
#'    \item Dry  
#'    }

Problem

#'\% replace %  

More informations are available on different website :
R package
Mastering Software Development in R
Text formatting reference sheet Learning more about Markdown

3) Creation of documentation

  1. Create your function with the new heading with roxygen2 (see part 2 Heading)
  2. Delete all files in man folder of your package
  3. Use a function of devtools package
devtools::document()
  1. Install and restart package in the "build" tab, your package will be check and install in your Rstudio session (Ctrl+Shift+B)
  2. Check the result with the "help" tab with your different function
  3. Restart your creation for each function or if you want to improve one


flogrc/piflow documentation built on May 24, 2019, 7:34 a.m.