Unset configuration settings.
Unset (i.e. delete) one or more
custom settings for the current project
from the optional YAML configuration file.
After that, tar_option_get()
will return the original
default values for those settings for the project.
tar_config_unset( names = character(0), config = Sys.getenv("TAR_CONFIG", "_targets.yaml"), project = Sys.getenv("TAR_PROJECT", "main") )
names |
Character vector of configuration settings to delete from the current project. |
config |
Character of length 1, file path of the YAML
configuration file with |
project |
Character of length 1, name of the current
|
NULL
(invisibly)
For several key functions like tar_make()
, the
default values of arguments are controlled though
tar_config_get()
. tar_config_get()
retrieves data
from an optional YAML configuration file.
You can control the settings in the YAML
file programmatically with tar_config_set()
.
The default file path of this YAML file is _targets.yaml
, and you can
set another path globally using the TAR_CONFIG
environment variable. The YAML file can store configuration
settings for multiple projects, and you can globally
set the default project with the TAR_PROJECT
environment
variable.
The structure of the YAML file
follows rules similar to the config
R package, e.g.
projects can inherit settings from one another using the inherits
field.
Exceptions include:
There is no requirement to have a configuration named "default"
.
Other projects do not inherit from the default project' automatically.
Not all fields need values because targets
already has defaults.
targets
does not actually invoke
the config
package. The implementation in targets
was written from scratch without viewing or copying any
part of the source code of config
.
Other configuration:
tar_config_get()
,
tar_config_set()
,
tar_envvars()
,
tar_option_get()
,
tar_option_reset()
,
tar_option_set()
if (identical(Sys.getenv("TAR_EXAMPLES"), "true")) { tar_dir({ # tar_dir() runs code from a temporary directory. tar_script(list(tar_target(x, 1 + 1))) tar_config_get("store") # "_targets" store_path <- tempfile() tar_config_set(store = store_path) tar_config_get("store") # Shows a temp file. tar_config_unset("store") tar_config_get("store") # _targets }) }
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.