Create all the scaffolding for a new project in a new directory. The scaffolding includes a README file, different folders to hold raw data, analyses, etc, and optionally also testthat
infrastructure. Also, optionally, set a private or public GitHub repo with continuous integration (Travis-CI, GitHub Actions...).
new_project(
name,
path = ".",
package = TRUE,
github = FALSE,
private.repo = TRUE,
ci = "none",
makefile = TRUE,
pipe = TRUE,
testthat = FALSE,
verbose = FALSE,
open.project = TRUE
)
Character. Name of the new project. A new folder will be created with that name.
Character. Path where the new project should be created (default is the current working directory).
Logical. Create package structure or a simple project?
Logical. Create GitHub repository? Note this requires some working infrastructure like git
and a GITHUB_PAT
. See instructions here https://usethis.r-lib.org/articles/articles/usethis-setup.html.
Logical. Default is TRUE.
Logical. Use continuous integration in your GitHub repository? Current options are "none" (default), "travis" (uses Travis-CI), "circle" (uses Circle-CI), "appveyor" (uses AppVeyor), or "gh-actions" (uses GitHub Actions).
Logical. If TRUE, adds a template makefile.R
file to the project.
Logical. Use magrittr's pipe in your package?
Logical. Add testthat infrastructure?
Print verbose output in the console while creating the new project? Default is FALSE.
Logical. If TRUE (the default) will open the newly created Rstudio project in a new session.
A new directory with R package structure, slightly modified.
If using github = TRUE, you will be asked if you want to commit some files. Reply positively to continue.
# NOT RUN {
library("template")
new_project("myproject")
new_project("myproject", github = TRUE, private.repo = TRUE)
# }
Run the code above in your browser using DataLab