pour: Generate package scaffolding for robust package setup

Description Usage Arguments Details Value See Also Examples

Description

Wrapper function around several package setup functions from the usethis and pkgpeanuts packages.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
pour(path = ".", account, name = NULL, description = NULL,
  license = c("mit", "gpl3", "apl2", "cc0"), host = "github",
  public = TRUE, testthat = TRUE, pkgdown = TRUE, appveyor = TRUE,
  travis = TRUE, codecov = TRUE, lintr = c("none", "user", "test"),
  revdep = TRUE, data_raw = TRUE, hex = TRUE, news = TRUE,
  code_of_conduct = TRUE, cran_comments = TRUE,
  clone_comments = TRUE, readme = TRUE, vignette = TRUE,
  depends = NULL, imports = NULL, suggests = NULL, remotes = NULL,
  spellcheck = TRUE, tibble = FALSE, pipe = FALSE,
  github_args = NULL)

Arguments

path

character, package directory. Package name used by pour is taken from the path's basename.

account

character, user account.

name

character, given and family name "given family", appears in licensing and pkgdown metadata. You can leave this NULL if pulling from global options or .Rprofile instead.

description

a named list providing fields to usethis::use_description or NULL to pull from defaults. Consider setting default fields in options, or even .Rprofile if you create a lot of packages.

license

character, one of "mit", "gpl3", "apl2" or "cc0".

host

"github" (default) or "bitbucket".

public

logical, public remote repository.

testthat

logical, use testthat.

pkgdown

logical, use pkgdown.

appveyor

logical, use Appveyor. Applicable if host = "github".

travis

logical, use Travis-CI. Applicable if host = "github".

codecov

logical, use covr package and integrate with codecov.io. Applicable if host = "github".

lintr

character, use lintr package. See details.

revdep

logical, use revdep.

data_raw

logical, use data-raw directory for raw repository data and package dataset preparation.

hex

logical, place default hex sticker package logo at man/figures/logo.png (see details) and a template script for customization at data-raw/hex.R.

news

logical, use NEWS.md.

code_of_conduct

logical, include CODE_OF_CONDUCT.md.

cran_comments

logical, add cran-comments.md template.

clone_comments

logical, add clone-comments.md template.

readme

logical, add README.Rmd template and update installation section. See update_readme_rmd.

vignette

logical, add package vignette template.

depends

character, vector of dependencies, e.g., "R (>= 3.5.0)", "showtext".

imports

character, as above.

suggests

character, as above.

remotes

character, as above.

spellcheck

logical, spell checking as unit test and add WORDLIST file for whitelisted words.

tibble

logical, for importing and re-exporting tibble.

pipe

logical, for importing and re-exporting magrittr pipe operator %>%.

github_args

named list, if you need to provide arguments to usethis::use_github.

Details

Run this function from the new package's root directory. The project should be brand new, but must exist. Make a new package project in RStudio. The eventual goal is to start a project from scratch, but currently this does not work due to issues involving git2r and usethis and making the initial git commit and push to new GitHub remote repo. For now, just leave path = ".".

pour wraps around the following functions: use_description, use_license, use_github_links, use_clone_comments, use_cran_comments,use_data_raw, use_news_md, use_testthat, use_vignette, use_readme_rmd, use_revdep, use_lintr, use_appveyor, use_travis, use_coverage, use_hex, and others. Most are optional, see arguments.

If using lintr with the new package, set lintr = "user" for interactive-only use of the lintr package. Set to "test" for setting up linting as a component of unit testing. The default is lintr = "none". See use_lintr for important details regarding unit testing with lintr in an R package.

If hex = TRUE, the default logo.png will not be created if the magick package is not installed. Instead, a message is printed notifying of this requirement. Being able to generate a default logo (that will surely be replaced later) is a very minor and unimportant feature. Therefore, pkgpeanuts does not have package dependencies or system requirements in this regard. This is optional.

If pkgdown = TRUE, a pkgdown site for R package documentation is also initialized, using a pkgdown directory in the package root directory containing template _pkgdown.yml and extra.css files. The docs directory is initially set for package website files and should be specified likewise in the remote repository settings for hosting.

Value

side effect of setting up various package files and configurations.

See Also

use_lintr, use_hex, use_clone_comments, update_readme_rmd

Examples

1
2
# Create new R package project with RStudio. Run command inside package root directory, e.g.:
## Not run: pour(account = "github_username")

leonawicz/pkgpeanuts documentation built on June 7, 2019, 2:56 a.m.