Skip to contents

Creates a new projr profile that overrides settings in _projr.yml. The profile becomes active when either the working directory (rprojroot::is_r_package$find_file()) or Sys.getenv("PROJR_PROFILE") is equal to profile.

Usage

projr_profile_create(
  profile = NULL,
  method = "key",
  silent = Sys.getenv("PROJR_TEST") == "TRUE"
)

Arguments

profile

character. If not NULL, then this is the name of the profile. If NULL and the environment variable PROJR_PROFILE is set, then made equal to its value. If the variable is not set, then made equal to the working directory.

method

"key" or "file". Specifies where the projr profile is specified. If "key" (default), then the additional profile is added as new keys in _projr.yml in the form directories-<profile> and build-<profile>. If "file", then the file _projr-<profile>.yml is created with all-null values for the sub-keys of the build and directories keys in _projr.yml.

Default is NULL.

silent

logical. If TRUE, then any messages are suppressed. Default is TRUE is the environment variable PROJR_TEST is "TRUE".

Value

Invisibly returns the new projr profile.

Details

Note that if any setting in projr profile-specific setting is empty (indicated by ~ in the YAML file by default), then the corresponding setting in _projr.yml is used.

If using method = "file", then the profile cannot be automatically specified from the working directory but must be specified by either PROJR_PROFILE or the profile argument.

See also

projr_profile_create_local,projr_yml_get