[Stable]

This is the underlying function used by: File -> New Project -> New Directory -> New NMproject. It creates a new analysis working directory with a directory structure similar to an R package.

nm_create_analysis_project(
  path,
  dirs = nm_default_dirs(),
  style = c("analysis", "analysis-package"),
  use_renv = FALSE,
  readme_template_package = "NMproject",
  ...
)

Arguments

path

Character path (relative or absolute) to project. If just specifying a name, this will create the analysis project in the current working directory. See details for naming requirements.

dirs

Character list or vector. Default = nm_default_dirs(). Can also handle an ordered string which is supplied by the RStudio project template interface.

style

Character. Either "analysis" or "analysis-package" See details for path requirements and function behaviour.

use_renv

Logical (default = FALSE). Should renv be used or not in project.

readme_template_package

Package name from which to load the README template (default = "NMproject")

...

Deprecated.

Details

The function works like as is inspired by starters::create_analysis_project(). There is no restriction on directory name. It is therefore possible to violate R package naming conventions.

When style = "analysis" is selected, the analysis directory will be package-like in structure, with the package name "localanalysis". For style = "analysis-package", path should contain only (ASCII) letters, numbers and dot, have at least two characters and start with a letter and not end in a dot. See Description file requirements for more information.

This is to cater to users who like underscores and aren't interested in creating a package.

Default modelling directories

Default modelling directories can be modified with nm_default_dirs option (see options() for information on how to modify this). A (partially) named list of directories to be used by nm_create_analysis_project Required names are "models", "scripts" and "results". By default these are set to "Models", "Scripts" and "Results", respectively. Additional nameless characters (e.g. "SourceData") correspond to additional modelling directories.

"SourceData":

intended for unmodified source datasets entering the analysis project.

"DerivedData":

intended for cleaned and processed NONMEM ready datasets

"Scripts":

intended for all R scripts

"Models":

intended for all NONMEM modelling

"Results":

intended as default location for run diagnostics, plots and tables

See also

nm_default_dirs() for modifying default directory structure.