Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau-lilly committed Aug 22, 2023
1 parent 059b410 commit b8d6c21
Show file tree
Hide file tree
Showing 60 changed files with 734 additions and 57 deletions.
1 change: 1 addition & 0 deletions R/tar_config_get.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#' or the default value if the setting is not available.
#' The data type of the return value depends on your choice
#' of `name`.
#' @inheritSection tar_meta Storage access
#' @inheritSection tar_config_set Configuration
#' @inheritParams tar_config_set
#' @param name Character of length 1, name of the specific
Expand Down
1 change: 1 addition & 0 deletions R/tar_config_set.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#' @family configuration
#' @description `tar_config_set()` writes special custom settings
#' for the current project to an optional YAML configuration file.
#' @inheritSection tar_meta Storage access
#' @section Configuration:
#' For several key functions like [tar_make()], the
#' default values of arguments are controlled though
Expand Down
1 change: 1 addition & 0 deletions R/tar_config_unset.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#' from the optional YAML configuration file.
#' After that, [tar_option_get()] will return the original
#' default values for those settings for the project.
#' @inheritSection tar_meta Storage access
#' @return `NULL` (invisibly)
#' @inheritSection tar_config_set Configuration
#' @inheritParams tar_config_set
Expand Down
1 change: 1 addition & 0 deletions R/tar_crew.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#' @description For the most recent run of the pipeline with [tar_make()]
#' where a `crew` controller was started, get summary-level information
#' of the workers.
#' @inheritSection tar_meta Storage access
#' @return A data frame one row per `crew` worker and the following columns:
#' * `controller`: name of the `crew` controller.
#' * `launches`: number of times the worker was launched.
Expand Down
1 change: 1 addition & 0 deletions R/tar_delete.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#' For patterns recorded in the metadata, all the branches
#' will be deleted. For patterns no longer in the metadata,
#' branches are left alone.
#' @inheritSection tar_meta Storage access
#' @inheritParams tar_validate
#' @param names Names of the targets to remove from `_targets/objects/`.
#' You can supply symbols
Expand Down
1 change: 1 addition & 0 deletions R/tar_destroy.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#' input/output files tracked with `tar_target(..., format = "file")`).
#' The next run of the pipeline will start from scratch,
#' and it will not skip any targets.
#' @inheritSection tar_meta Storage access
#' @return `NULL` (invisibly).
#' @inheritParams tar_validate
#' @param destroy Character of length 1, what to destroy. Choices:
Expand Down
2 changes: 1 addition & 1 deletion R/tar_edit.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' @details The target script file is an R code file
#' that defines the pipeline. The default path is `_targets.R`,
#' but the default for the current project
#' can be configured with [tar_config_set()].
#' can be configured with [tar_config_set()]
#' @inheritParams tar_validate
tar_edit <- function(script = targets::tar_config_get("script")) {
# Covered in tests/interactive/test-tar_edit.R # nolint
Expand Down
1 change: 1 addition & 0 deletions R/tar_errored.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#' @family progress
#' @description List targets whose progress is `"errored"`.
#' @return A character vector of errored targets.
#' @inheritSection tar_meta Storage access
#' @inheritParams tar_progress
#' @param names Optional, names of the targets. If supplied, the
#' function restricts its output to these targets.
Expand Down
1 change: 1 addition & 0 deletions R/tar_glimpse.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#' renders faster. Also, `tar_glimpse()` omits functions and other global
#' objects by default (but you can include them with `targets_only = FALSE`).
#' @inheritSection tar_network Dependency graph
#' @inheritSection tar_meta Storage access
#' @return A `visNetwork` HTML widget object.
#' @inheritParams tar_network
#' @param targets_only Logical, whether to restrict the output to just targets
Expand Down
1 change: 1 addition & 0 deletions R/tar_invalidate.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#' For patterns recorded in the metadata, all the branches
#' will be invalidated. For patterns no longer in the metadata,
#' branches are left alone.
#' @inheritSection tar_meta Storage access
#' @return `NULL` (invisibly).
#' @inheritParams tar_validate
#' @param names Names of the targets to remove from the metadata list.
Expand Down
2 changes: 1 addition & 1 deletion R/tar_load.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#' [tar_load_everything()] is shorthand for `tar_load(everything())`
#' to load all targets.
#' @return Nothing.
#' @inheritSection tar_read Limited scope
#' @inheritSection tar_meta Storage access
#' @inheritParams tar_load_raw
#' @param names Names of the targets to load.
#' You may supply `tidyselect` helpers like [any_of()] and [starts_with()].
Expand Down
1 change: 0 additions & 1 deletion R/tar_load_everything.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#' @description Shorthand for `tar_load(everything())` to load all
#' targets with entries in the metadata.
#' @return Nothing.
#' @inheritSection tar_read Limited scope
#' @inheritParams tar_load
#' @examples
#' if (identical(Sys.getenv("TAR_EXAMPLES"), "true")) { # for CRAN
Expand Down
1 change: 1 addition & 0 deletions R/tar_load_globals.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#' in `tar_option_get("packages")` (default: `(.packages())`)
#' using `library()` with `lib.loc` defined in `tar_option_get("library")`
#' (default: `NULL`).
#' @inheritSection tar_meta Storage access
#' @return `NULL` (invisibly).
#' @inheritParams tar_config_set
#' @param envir Environment to source the target script (default: `_targets.R`).
Expand Down
2 changes: 1 addition & 1 deletion R/tar_load_raw.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#' Do not use in `knitr` or R Markdown reports with `tarchetypes::tar_knit()`
#' or `tarchetypes::tar_render()`.
#' @return Nothing.
#' @inheritSection tar_read Limited scope
#' @inheritSection tar_meta Storage access
#' @inheritParams tar_read
#' @param names Character vector, names of the targets to load.
#' Names are expected to appear in the metadata in `_targets/meta`.
Expand Down
1 change: 1 addition & 0 deletions R/tar_make.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#' back into R, and see
#' <https://docs.ropensci.org/targets/reference/index.html#clean>
#' to manage output files.
#' @inheritSection tar_meta Storage access
#' @return `NULL` except if `callr_function = callr::r_bg()`, in which case
#' a handle to the `callr` background process is returned. Either way,
#' the value is invisibly returned.
Expand Down
1 change: 1 addition & 0 deletions R/tar_make_clustermq.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#' or <https://books.ropensci.org/targets/hpc.html>.
#' `clustermq` is not a strict dependency of `targets`,
#' so you must install `clustermq` yourself.
#' @inheritSection tar_meta Storage access
#' @return `NULL` except if `callr_function = callr::r_bg()`, in which case
#' a handle to the `callr` background process is returned. Either way,
#' the value is invisibly returned.
Expand Down
1 change: 1 addition & 0 deletions R/tar_make_future.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#' so you must install `future` yourself.
#' @details To configure `tar_make_future()` with a computing cluster,
#' see the `future.batchtools` package documentation.
#' @inheritSection tar_meta Storage access
#' @return `NULL` except if `callr_function = callr::r_bg()`, in which case
#' a handle to the `callr` background process is returned. Either way,
#' the value is invisibly returned.
Expand Down
1 change: 1 addition & 0 deletions R/tar_manifest.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#' @family inspect
#' @description Along with [tar_visnetwork()] and [tar_glimpse()],
#' `tar_manifest()` helps check that you constructed your pipeline correctly.
#' @inheritSection tar_meta Storage access
#' @return A data frame of information about the targets in the pipeline.
#' Rows appear in topological order (the order they will run
#' without any influence from parallel computing or priorities).
Expand Down
1 change: 1 addition & 0 deletions R/tar_mermaid.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#' @details `mermaid.js` is a JavaScript library for constructing
#' static visualizations of graphs.
#' @inheritSection tar_network Dependency graph
#' @inheritSection tar_meta Storage access
#' @return A character vector of lines of code of the `mermaid.js` graph.
#' You can visualize the graph by copying the text
#' into a public online `mermaid.js` editor or a `mermaid` GitHub code chunk
Expand Down
12 changes: 12 additions & 0 deletions R/tar_meta.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@
#' [tar_progress()] shows information on targets that are running.
#' That is why the number of branches may disagree between [tar_meta()]
#' and [tar_progress()] for actively running pipelines.
#' @inheritSection tar_meta Storage access
#' @section Storage access:
#' Several functions like `tar_make()`, `tar_read()`, `tar_load()`,
#' `tar_meta()`, and `tar_progress()` read or modify
#' the local data store of the pipeline.
#' The local data store is in flux while a pipeline is running,
#' and depending on how distributed computing or cloud computing is set up,
#' not all targets can even reach it. So please do not call these
#' functions from inside a target as part of a running
#' pipeline. The only exception is literate programming
#' target factories in the `tarchetypes` package such as `tar_render()`
#' and `tar_quarto()`.
#' @return A data frame with one row per target/object and the selected fields.
#' @inheritParams tar_validate
#' @param names Optional, names of the targets. If supplied, `tar_meta()`
Expand Down
1 change: 1 addition & 0 deletions R/tar_objects.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#' @description List targets currently saved to `_targets/objects/`
#' or the cloud. Does not include local files
#' with `tar_target(..., format = "file", repository = "local")`.
#' @inheritSection tar_meta Storage access
#' @return Character vector of targets saved to `_targets/objects/`.
#' @inheritParams tar_validate
#' @param names Optional `tidyselect` selector such as
Expand Down
1 change: 1 addition & 0 deletions R/tar_outdated.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#' @details Requires that you define a pipeline
#' with a target script file (default: `_targets.R`).
#' (See [tar_script()] for details.)
#' @inheritSection tar_meta Storage access
#' @return Names of the outdated targets.
#' @param names Names of the targets. `tar_outdated()` will check
#' these targets and all upstream ancestors in the dependency graph.
Expand Down
1 change: 1 addition & 0 deletions R/tar_poll.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#' @family progress
#' @description Print the information in [tar_progress_summary()]
#' at regular intervals.
#' @return `NULL` (invisibly). Called for its side effects.
#' @inheritParams tar_progress_summary
#' @param interval Number of seconds to wait between iterations
#' of polling progress.
Expand Down
1 change: 1 addition & 0 deletions R/tar_process.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#' check the status with `tar_pid() %in% ps::ps_pids()`
#' before running another call to [tar_make()]
#' for the same project.
#' @inheritSection tar_meta Storage access
#' @return A data frame with metadata on the most recent main R process
#' to orchestrate the targets of the current project.
#' The output includes the `pid` of the main process.
Expand Down
1 change: 1 addition & 0 deletions R/tar_progress.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#' @family progress
#' @description Read a project's target progress data for the most recent
#' run of [tar_make()] or similar. Only the most recent record is shown.
#' @inheritSection tar_meta Storage access
#' @return A data frame with one row per target and the following columns:
#' * `name`: name of the target.
#' * `type`: type of target: `"stem"` for non-branching targets,
Expand Down
1 change: 1 addition & 0 deletions R/tar_prune.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#' @description Remove target values from `_targets/objects/` and the cloud
#' and remove target metadata from `_targets/meta/meta`
#' for targets that are no longer part of the pipeline.
#' @inheritSection tar_meta Storage access
#' @details
#' `tar_prune()` is useful if you recently worked through
#' multiple changes to your project and are now trying to
Expand Down
9 changes: 1 addition & 8 deletions R/tar_read.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,7 @@
#' @description Read a target's return value from its file in
#' `_targets/objects/`. For dynamic files (i.e. `format = "file"`)
#' the paths are returned.
#' @section Limited scope:
#' `tar_read()` and `tar_load()`
#' are only for exploratory analysis and literate programming,
#' and `tar_read_raw()` and `tar_load_raw()` are only
#' for exploratory analysis. `targets` automatically
#' loads the correct dependencies into memory when the pipeline
#' is running, so invoking these functions
#' from inside a target is rarely advisable.
#' @inheritSection tar_meta Storage access
#' @return The target's return value from its file in
#' `_targets/objects/`, or the paths to the custom files and directories
#' if `format = "file"` was set.
Expand Down
2 changes: 1 addition & 1 deletion R/tar_read_raw.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' @return The target's return value from its file in
#' `_targets/objects/`, or the paths to the custom files and directories
#' if `format = "file"` was set.
#' @inheritSection tar_read Limited scope
#' @inheritSection tar_meta Storage access
#' @inheritParams tar_validate
#' @param name Character, name of the target to read.
#' @param branches Integer of indices of the branches to load
Expand Down
1 change: 1 addition & 0 deletions R/tar_source.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#' `tar_source()` recursively looks for files ending
#' in `.R` or `.r`, and it runs each with
#' `eval(parse(text = readLines(script_file, warn = FALSE)), envir)`.
#' @inheritSection tar_meta Storage access
#' @return `NULL` (invisibly)
#' @param files Character vector of file and directory paths
#' to look for R scripts to run. Paths must either be absolute
Expand Down
1 change: 1 addition & 0 deletions R/tar_visnetwork.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#' @description Visualize the pipeline dependency graph with a `visNetwork`
#' HTML widget.
#' @inheritSection tar_network Dependency graph
#' @inheritSection tar_meta Storage access
#' @return A `visNetwork` HTML widget object.
#' @inheritParams tar_glimpse
#' @inheritParams tar_network
Expand Down
26 changes: 26 additions & 0 deletions man/tar_config_get.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions man/tar_config_set.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions man/tar_config_unset.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions man/tar_crew.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b8d6c21

Please sign in to comment.