Skip to content

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_theme object created by new_theme() or a pre-set theme function.

open

Whether to activate the new project after creating it, following the convention of usethis::create_project() and usethis::create_package(): when TRUE, 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 to rlang::is_interactive(), so it opens interactively but stays inert in scripts, tests, and non-interactive callers.

Value

The normalized project path (invisibly).

Examples

if (FALSE) { # \dontrun{
create_project("~/projects/my-analysis", r_analysis())
create_project("my-targets-project", r_targets() + claude_r_targets())
} # }