Skip to contents

Creates a package template in a new folder. Use this function when you want to start a new package. Please DO READ vignette("getting_started") before running this function.

Usage

create_package(
  package,
  path = ".",
  title,
  description,
  keywords,
  language = "en-GB",
  license = c("GPL-3", "MIT"),
  communities = character(0),
  maintainer
)

Arguments

package

Name of the new package.

path

Where to create the package directory.

title

A single sentence with the title of the package.

description

A single paragraph describing the package.

keywords

A vector of keywords.

language

Language of the project in xx-YY format. xx is the two letter code for the language. YY is the two letter code for the language variant. E.g. en-GB for British English, en-US for American English, nl-BE for Belgian Dutch.

license

What type of license should be used? Choice between GPL-3 and MIT. Default GPL-3.

communities

An optional vector of Zenodo community id's.

maintainer

When missing, the function interactively lets you add the maintainer and other authors. Otherwise it must be the output of utils::person().

Details

What you get with a checklist setup:

  • minimal folder structure and files required for an R package using INBO guidelines with GPL-3 or MIT license.

  • an RStudio project file

  • a local git repository

  • an initial NEWS.md file

  • a template for an README.Rmd

  • set-up for automated checks and releases of the package using GitHub Actions.

  • a code of conduct and contributing guidelines.

  • the set-up for a pkgdown website using the INBO corporate identity.

Examples

# maintainer in `utils::person()` format
maintainer <- person(
  given = "Thierry",
  family = "Onkelinx",
  role = c("aut", "cre"),
  email = "thierry.onkelinx@inbo.be",
  comment = c(ORCID = "0000-0001-8804-4216")
)

# creating the package
path <- tempfile()
dir.create(path)
create_package(
  path = path, package = "packagename", title = "package title",
  description = "A short description.", maintainer = maintainer,
  language = "en-GB", license = "GPL-3", keywords = "keyword"
)
#> package created at `/tmp/RtmptXqCpe/file305d8d64d74/packagename`