Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tar_unscript

Remove target script helper files.


Description

Remove target script helper files (default: _targets_r/) that were created by Target Markdown.

Usage

tar_unscript(script = targets::tar_config_get("script"))

Arguments

script

Character of length 1, path to the target script file. Defaults to tar_config_get("script"), which in turn defaults to _targets.R. When you set this argument, the value of tar_config_get("script") is temporarily changed for the current function call. See tar_script(), tar_config_get(), and tar_config_set() for details about the target script file and how to set it persistently for a project.

Details

Target Markdown code chunks create R scripts in a folder called _targets_r/ in order to aid the automatically supplied _targets.R file. Over time, the number of script files starts to build up, and targets has no way of automatically removing helper script files that are no longer necessary. To keep your pipeline up to date with the code chunks in the Target Markdown document(s), it is good practice to call tar_unscript() at the beginning of your first Target Markdown document. That way, extraneous/discarded targets are automatically removed from the pipeline when the document starts render.

If the target script is at some alternative path, e.g. custom/script.R, the helper scripts are in custom/script_r/. tar_unscript() works on the helper scripts as long as your project configuration settings correctly identify the correct target script.

Value

NULL (invisibly).

Examples

tar_dir({ # tar_dir() runs code from a temporary directory.
tar_unscript()
})

targets

Dynamic Function-Oriented 'Make'-Like Declarative Workflows

v0.10.0
MIT + file LICENSE
Authors
William Michael Landau [aut, cre] (<https://orcid.org/0000-0003-1878-3253>), Matthew T. Warkentin [ctb], Samantha Oliver [rev] (<https://orcid.org/0000-0001-5668-1165>), Tristan Mahr [rev] (<https://orcid.org/0000-0002-8890-5116>), Eli Lilly and Company [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.