Skip to contents

new_package() create a package skeleton based on my preferred folder structure. It is somewhat experimental in nature and should be treated accordingly.

Usage

new_package(
  name = "mypackage",
  dir = ".",
  firstname = getOption("ympes.firstname", "Joe"),
  surname = getOption("ympes.surname", "Bloggs"),
  email = getOption("ympes.email", "Joe.Bloggs@missing.com"),
  orcid = getOption("ympes.orcid", default = NULL),
  enter = TRUE
)

np(
  name = "mypackage",
  dir = ".",
  firstname = getOption("ympes.firstname", "Joe"),
  surname = getOption("ympes.surname", "Bloggs"),
  email = getOption("ympes.email", "Joe.Bloggs@missing.com"),
  orcid = getOption("ympes.orcid", default = NULL),
  enter = TRUE
)

Arguments

name

[character]

Package name

dir

[character]

Directory to start in.

firstname

[character]

Maintainer's firstname.

surname

[character]

Maintainer's surname.

email

[character]

Maintainer's email address.

orcid

[character]

Maintainer's ORCID.

enter

[bool]

Should you move in to the package directory after creation.

Only applicable in interactive sessions.

Value

Created directory (invisibly)

Examples


# usage without entering directory
p <- new_package("my_package_1", dir = tempdir(), enter = FALSE)
#> 
#> Creating directory structure ...... 
#> (DONE)
#> Adding Makefile ................... 
#> (DONE)
#> Adding .gitignore ................. 
#> (DONE)
#> Adding .Rbuildignore .............. 
#> (DONE)
#> Adding .Rproj ..................... 
#> (DONE)
#> Creating DESCRIPTION .............. 
#> (DONE)
#> 
#> Complete.
#> 
#> Package skeleton created in
#>    /tmp/RtmpMlzAJ5/my_package_1

# clean up
unlink(p, recursive = TRUE)