Notes about using the targets
R package, focused on a few useful
functions and options. For a comprehensive reference, see the {targets}
user manual: https://books.ropensci.org/targets/
tar_visnetwork()
tar_manifest()
tar_glimpse()
tar_make()
tar_invalidate()
_targets.R
file, just the outputs in
the _targets
folder): tar_destroy()
These functions allow you to view or load the output object from any
target (e.g., a dataset). Before using any of these functions, make sure
to load any packages required to use the given object/dataset (e.g., if
the target object being retrieved is geospatial data, load the sf
package - otherwise you’ll get an error when you try to use that
object):
tar_read()
tar_load()
Use workspaces:
tar_option_set(workspaces = c(...))
tar_option_set(workspace_on_error = TRUE)
tar_workspace(workspace_name)
tar_workspaces()
tarchetypes::tar_quarto()
targets::tar_read(target_name)
store = here::here(tar_config_get('store')))
in the
targets::tar_read()
call - this should allow for manual rendering
(i.e. without having to render using tar_make()
each time) (might
not be the best practice though?)tar_option_set()
in the
_targets.R
file)tarchetypes::tar_render()