library_template: Regular Expression Library Package Template

Description Usage Arguments Examples

Description

This function creates a package template to manage regular expressions. It utiizes a framework with defaults that expects the user to use testthat to test the library's reguar expressions.

Usage

1
2
3
4
library_template(path, name = getOption("name"), email = getOption("email"),
  news = TRUE, readme = TRUE, rstudio = TRUE, gitignore = TRUE,
  testthat = TRUE, travis = TRUE, coverage = TRUE,
  github.user = getOption("github.user"), samples = TRUE)

Arguments

path

location to create new regular expression library package. The last component of the path will be used as the package name.

name

A named vector that minimally contains the user's first and last name (e.g., c(first="Tyler", last="Rinker"))). This can be set in the user's options in the ‘.Rprofile’; for example:
options(name = c(first="Tyler", middle = "W.", last="Rinker")).

email

An email address to use for CRAN maintainer. This can be set in the user's options in the ‘.Rprofile’; for example:
options(email = "tyler.rinker@gmail.com").

news

logical. If TRUE a ‘NEWS’ file is generated.

readme

logical. If TRUE a ‘README.md’ file is generated.

rstudio

logical. If TRUE it is assumed RStudio will be used and a ‘xxx.proj’ file is generated.

gitignore

logical. If TRUE a ‘.gitignore’ file is generated.

testthat

logical. If TRUE it is assumed testthat will be used and a ‘test’ subfolder with appropriate testthat subdirectories and files will be created.

travis

logical. If TRUE it is assumed Travis-CI will be used and a ‘travis.yml’ file is generated. For more on managing a ‘travis.yml’ with R see: https://github.com/craigcitro/r-travis.

coverage

logical. If TRUE it is assumed covr will be used. This information will be added to the ‘travis.yml’.

github.user

The user's GitHub user name. This can be set in the user's options in the ‘.Rprofile’; for example:
options(github.user = "trinker").

samples

logical. If TRUE a sample ‘.R’ regular expression file will be placed in the ‘R’ directory. Additionally, if testthat = TRUE, a sample ‘.R’ unit test will be placed in the ‘./tests/testthat’ directory.

Examples

1
2
3
4
## Not run: 
library_template("DELETE_ME")

## End(Not run)

trinker/regextools documentation built on May 31, 2019, 9:51 p.m.