Creates a new project directory and applies a theme to it.
Usage
create_project(path, theme, open = rlang::is_interactive())Arguments
- path
Path for the new project directory. Resolved to an absolute path via
fs::path_abs().- theme
A
prefab_themeobject created bynew_theme(),theme_from_dir(), or a pre-set theme function, or a path to a directory of template files.- open
Whether to activate the new project after creating it, following the convention of
usethis::create_project()andusethis::create_package(): whenTRUE, the project opens in a new session/window in RStudio/Positron, or in other editors the working directory of the active session is changed into the new project. Defaults torlang::is_interactive(), so it opens interactively but stays inert in scripts, tests, and non-interactive callers.
See also
theme_from_dir() for how a template directory is read.
Examples
if (FALSE) { # \dontrun{
create_project("~/projects/my-analysis", r_analysis())
create_project("my-targets-project", r_targets() + claude_r_targets())
# A directory of template files
create_project("~/projects/my-report", "~/templates/quarto-report")
} # }
