Creates a new 'worcs' project. This function is invoked by the 'RStudio' project template manager, but can also be called directly to create a WORCS project through syntax or the console.
Usage
worcs_project(
path = "worcs_project",
manuscript = "APA6",
preregistration = "cos_prereg",
add_license = "CC_BY_4.0",
use_renv = TRUE,
use_targets = FALSE,
remote_repo = "https",
verbose = TRUE,
...
)
Arguments
- path
Character, indicating the directory in which to create the 'worcs' project. Default: 'worcs_project'.
- manuscript
Character, indicating what template to use for the 'R Markdown' manuscript. Default: 'APA6'. Available choices include
APA6
from thepapaja
package, agithub_document
, and templates included in therticles
package. For more information, seeadd_manuscript
.- preregistration
Character, indicating what template to use for the preregistration. Default: 'cos_prereg'. Available choices include:
"PSS", "Secondary", "None"
, and all templates from theprereg
package. For more information, seeadd_preregistration
.- add_license
Character, indicating what license to include. Default: 'ccby'. Available options include:
c("cc0", "ccby", "gpl", "gpl3", "agpl", "agpl3", "apache", "apl2", "lgpl", "mit", "proprietary", "None"
. For more information, seeuse_cc0_license
.- use_renv
Logical, indicating whether or not to use 'renv' to make the project reproducible. Default: TRUE. See
init
.- use_targets
Logical, indicating whether or not to use 'targets' to create a Make-like pipeline. Default: FALSE See
targets-package
.- remote_repo
Character, URL of, or name for, the remote repository for this project. If a URL of an existing repository is specified, it should have the form
https://github.com[username][repo].git
(preferred) orgit@[...].git
(if using SSH). Alternatively, a name for a new repository can be provided. If a 'GitHub' user is authenticated on your device, this repository will be created on your account. Finally, a commit will be made containing the 'README.md' file, and will be pushed to the remote repository. Default: 'https', which results in no repository being created.- verbose
Logical. Whether or not to print messages to the console during project creation. Default: TRUE
- ...
Additional arguments passed to and from functions.
Examples
the_test <- "worcs_template"
old_wd <- getwd()
dir.create(file.path(tempdir(), the_test))
do.call(git_user, worcs:::get_user())
#> ℹ Checking 'Git' credentials.
#> ✔ Checking 'Git' credentials. ... done
#>
#> ℹ Checking 'Git' credentials.
#> ✔ Checking 'Git' credentials. ... done
#>
#> To set the 'Git' username and email, call 'git_user()' with the argument 'overwrite = TRUE'.
worcs_project(file.path(tempdir(), the_test, "worcs_project"),
manuscript = "github_document",
preregistration = "None",
add_license = "None",
use_renv = FALSE,
remote_repo = "https")
#> ℹ Initializing 'Git' repository.
#> ✔ Initializing 'Git' repository. ... done
#>
#> ℹ Writing ".worcs" file.
#> ✔ Writing ".worcs" file. ... done
#>
#> ℹ Copying standard files.
#> ✔ Copying standard files. ... done
#>
#> ✔ Creating manuscript files.
#> ✔ Adding recipe to '.worcs'.
#> ✔ Creating first commit (committing README.md).
setwd(old_wd)
unlink(file.path(tempdir(), the_test))