Skip to content

Commit

Permalink
More all_of() -> any_of()
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau-lilly committed Sep 26, 2022
1 parent dd64142 commit d17889f
Show file tree
Hide file tree
Showing 53 changed files with 93 additions and 93 deletions.
4 changes: 2 additions & 2 deletions R/tar_built.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' @param names Optional, names of the targets. If supplied, the
#' function restricts its output to these targets.
#' You can supply symbols
#' or `tidyselect` helpers like [all_of()] and [starts_with()].
#' or `tidyselect` helpers like [any_of()] and [starts_with()].
#' @examples
#' if (identical(Sys.getenv("TAR_EXAMPLES"), "true")) {
#' tar_dir({ # tar_dir() runs code from a temporary directory.
Expand All @@ -19,7 +19,7 @@
#' }, ask = FALSE)
#' tar_make()
#' tar_built()
#' tar_built(starts_with("y_")) # see also all_of()
#' tar_built(starts_with("y_")) # see also any_of()
#' })
#' }
tar_built <- function(
Expand Down
4 changes: 2 additions & 2 deletions R/tar_canceled.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' @param names Optional, names of the targets. If supplied, the
#' function restricts its output to these targets.
#' You can supply symbols
#' or `tidyselect` helpers like [all_of()] and [starts_with()].
#' or `tidyselect` helpers like [any_of()] and [starts_with()].
#' @examples
#' if (identical(Sys.getenv("TAR_EXAMPLES"), "true")) {
#' tar_dir({ # tar_dir() runs code from a temporary directory.
Expand All @@ -19,7 +19,7 @@
#' }, ask = FALSE)
#' tar_make()
#' tar_canceled()
#' tar_canceled(starts_with("y_")) # see also all_of()
#' tar_canceled(starts_with("y_")) # see also any_of()
#' })
#' }
tar_canceled <- function(
Expand Down
2 changes: 1 addition & 1 deletion R/tar_delete.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#' @inheritParams tar_validate
#' @param names Names of the targets to remove from `_targets/objects/`.
#' You can supply symbols
#' or `tidyselect` helpers like [all_of()] and [starts_with()].
#' or `tidyselect` helpers like [any_of()] and [starts_with()].
#' @param cloud Logical of length 1, whether to delete objects
#' from the cloud if applicable (e.g. AWS, GCP). If `FALSE`,
#' files are not deleted from the cloud.
Expand Down
4 changes: 2 additions & 2 deletions R/tar_errored.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' @param names Optional, names of the targets. If supplied, the
#' function restricts its output to these targets.
#' You can supply symbols
#' or `tidyselect` helpers like [all_of()] and [starts_with()].
#' or `tidyselect` helpers like [any_of()] and [starts_with()].
#' @examples
#' if (identical(Sys.getenv("TAR_EXAMPLES"), "true")) {
#' tar_dir({ # tar_dir() runs code from a temporary directory.
Expand All @@ -19,7 +19,7 @@
#' }, ask = FALSE)
#' tar_make()
#' tar_errored()
#' tar_errored(starts_with("y_")) # see also all_of()
#' tar_errored(starts_with("y_")) # see also any_of()
#' })
#' }
tar_errored <- function(
Expand Down
2 changes: 1 addition & 1 deletion R/tar_glimpse.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#' )
#' }, ask = FALSE)
#' tar_glimpse()
#' tar_glimpse(allow = starts_with("y")) # see also all_of()
#' tar_glimpse(allow = starts_with("y")) # see also any_of()
#' })
#' }
tar_glimpse <- function(
Expand Down
2 changes: 1 addition & 1 deletion R/tar_invalidate.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#' @inheritParams tar_validate
#' @param names Names of the targets to remove from the metadata list.
#' You can supply symbols
#' or `tidyselect` helpers like [all_of()] and [starts_with()].
#' or `tidyselect` helpers like [any_of()] and [starts_with()].
#' @examples
#' if (identical(Sys.getenv("TAR_EXAMPLES"), "true")) {
#' tar_dir({ # tar_dir() runs code from a temporary directory.
Expand Down
4 changes: 2 additions & 2 deletions R/tar_load.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#' @inheritSection tar_read Limited scope
#' @inheritParams tar_load_raw
#' @param names Names of the targets to load.
#' You may supply `tidyselect` helpers like [all_of()] and [starts_with()].
#' You may supply `tidyselect` helpers like [any_of()] and [starts_with()].
#' Names are selected from the metadata in `_targets/meta`,
#' which may include errored targets.
#' @examples
Expand All @@ -28,7 +28,7 @@
#' ls() # Does not have "y1", "y2", or "z".
#' tar_load(starts_with("y"))
#' ls() # Has "y1" and "y2" but not "z".
#' tar_load(all_of("z"))
#' tar_load(any_of("z"))
#' ls() # Has "y1", "y2", and "z".
#' })
#' }
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 @@ -35,7 +35,7 @@
#' )
#' }, ask = FALSE)
#' tar_make()
#' tar_load_raw(all_of(c("y1", "y2")))
#' tar_load_raw(any_of(c("y1", "y2")))
#' y1
#' y2
#' })
Expand Down
4 changes: 2 additions & 2 deletions R/tar_make.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
#' @inheritParams tar_validate
#' @param names Names of the targets to build or check. Set to `NULL` to
#' check/build all the targets (default). Otherwise, you can supply
#' `tidyselect` helpers like [all_of()] and [starts_with()].
#' `tidyselect` helpers like [any_of()] and [starts_with()].
#' Because [tar_make()] and friends run the pipeline in a new R session,
#' if you pass a character vector to a tidyselect helper, you will need
#' to evaluate that character vector early with `!!`, e.g.
#' `tar_make(names = all_of(!!your_vector))`.
#' `tar_make(names = any_of(!!your_vector))`.
#' Applies to ordinary targets (stem) and whole dynamic branching targets
#' (patterns) but not to individual dynamic branches.
#' @param shortcut Logical of length 1, how to interpret the `names` argument.
Expand Down
4 changes: 2 additions & 2 deletions R/tar_manifest.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' @param names Names of the targets to show. Set to `NULL` to
#' show all the targets (default). Otherwise, you can supply
#' symbols, a character vector, or `tidyselect` helpers like
#' [all_of()] and [starts_with()].
#' [any_of()] and [starts_with()].
#' @param fields Names of the fields, or columns, to show. Set to `NULL` to
#' show all the fields (default). Otherwise, you can supply
#' `tidyselect` helpers like [starts_with()].
Expand Down Expand Up @@ -69,7 +69,7 @@
#' }
tar_manifest <- function(
names = NULL,
fields = tidyselect::all_of(c("name", "command", "pattern")),
fields = tidyselect::any_of(c("name", "command", "pattern")),
drop_missing = TRUE,
callr_function = callr::r,
callr_arguments = targets::tar_callr_args_default(callr_function),
Expand Down
6 changes: 3 additions & 3 deletions R/tar_meta.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
#' @param names Optional, names of the targets. If supplied, `tar_meta()`
#' only returns metadata on these targets.
#' You can supply symbols
#' or `tidyselect` helpers like [all_of()] and [starts_with()].
#' or `tidyselect` helpers like [any_of()] and [starts_with()].
#' If `NULL`, all names are selected.
#' @param fields Optional, names of columns/fields to select. If supplied,
#' `tar_meta()` only returns the selected metadata columns.
#' If `NULL`, all fields are selected.
#' You can supply symbols or `tidyselect` helpers
#' like [all_of()] and [starts_with()].
#' like [any_of()] and [starts_with()].
#' The `name` column is always included first
#' no matter what you select. Choices:
#' * `name`: name of the target or global object.
Expand Down Expand Up @@ -77,7 +77,7 @@
#' }, ask = FALSE)
#' tar_make()
#' tar_meta()
#' tar_meta(starts_with("y_")) # see also all_of()
#' tar_meta(starts_with("y_")) # see also any_of()
#' })
#' }
tar_meta <- function(
Expand Down
2 changes: 1 addition & 1 deletion R/tar_network.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#' resolved, so it will not speed up execution.
#' Set to `NULL` to exclude no vertices.
#' Otherwise, you can supply symbols or `tidyselect`
#' helpers like [all_of()] and [starts_with()].
#' helpers like [any_of()] and [starts_with()].
#' @param outdated Logical, whether to show colors to distinguish outdated
#' targets from up-to-date targets. (Global functions and objects
#' still show these colors.) Looking for outdated targets
Expand Down
4 changes: 2 additions & 2 deletions R/tar_newer.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#' @param names Names of eligible targets. Targets excluded from `names`
#' will not be returned even if they are newer than the given `time`.
#' You can supply symbols
#' or `tidyselect` helpers like [all_of()] and [starts_with()].
#' or `tidyselect` helpers like [any_of()] and [starts_with()].
#' If `NULL`, all names are eligible.
#' @param time A `POSIXct` object of length 1, time threshold.
#' Targets newer than this time stamp are returned.
Expand All @@ -38,7 +38,7 @@
#' # Invalidate all targets targets newer than 1 week ago
#' # so they run on the next tar_make().
#' invalidate_these <- tar_newer(Sys.time() - as.difftime(1, units = "weeks"))
#' tar_invalidate(all_of(invalidate_these))
#' tar_invalidate(any_of(invalidate_these))
#' tar_make()
#' })
#' }
Expand Down
4 changes: 2 additions & 2 deletions R/tar_objects.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' @return Character vector of targets saved to `_targets/objects/`.
#' @inheritParams tar_validate
#' @param names Optional `tidyselect` selector such as
#' [all_of()] or [starts_with()] to return
#' [any_of()] or [starts_with()] to return
#' a tactical subset of target names.
#' If `NULL`, all names are selected.
#' @param cloud Logical of length 1, whether to include
Expand All @@ -21,7 +21,7 @@
#' }, ask = FALSE)
#' tar_make()
#' tar_objects()
#' tar_objects(starts_with("x")) # see also all_of()
#' tar_objects(starts_with("x")) # see also any_of()
#' })
#' }
tar_objects <- function(
Expand Down
4 changes: 2 additions & 2 deletions R/tar_older.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#' @param names Names of eligible targets. Targets excluded from `names`
#' will not be returned even if they are old.
#' You can supply symbols
#' or `tidyselect` helpers like [all_of()] and [starts_with()].
#' or `tidyselect` helpers like [any_of()] and [starts_with()].
#' If `NULL`, all names are eligible.
#' @param time A `POSIXct` object of length 1, time threshold.
#' Targets older than this time stamp are returned.
Expand All @@ -42,7 +42,7 @@
#' # Invalidate all targets targets older than 1 week from now
#' # so they run on the next tar_make().
#' invalidate_these <- tar_older(Sys.time() + as.difftime(1, units = "weeks"))
#' tar_invalidate(all_of(invalidate_these))
#' tar_invalidate(any_of(invalidate_these))
#' tar_make()
#' })
#' }
Expand Down
2 changes: 1 addition & 1 deletion R/tar_outdated.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' these targets and all upstream ancestors in the dependency graph.
#' Set `names` to `NULL` to check/build all the targets (default).
#' Otherwise, you can supply symbols
#' or `tidyselect` helpers like [all_of()] and [starts_with()].
#' or `tidyselect` helpers like [any_of()] and [starts_with()].
#' Applies to ordinary targets (stem) and whole dynamic branching targets
#' (patterns) but not to individual dynamic branches.
#' @param shortcut Logical of length 1, how to interpret the `names` argument.
Expand Down
2 changes: 1 addition & 1 deletion R/tar_process.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#' If supplied, `tar_process()`
#' returns only the rows of the names you select.
#' You can supply symbols
#' or `tidyselect` helpers like [all_of()] and [starts_with()].
#' or `tidyselect` helpers like [any_of()] and [starts_with()].
#' If `NULL`, all names are selected.
#' @examples
#' if (identical(Sys.getenv("TAR_EXAMPLES"), "true")) {
Expand Down
4 changes: 2 additions & 2 deletions R/tar_progress.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#' @param names Optional, names of the targets. If supplied, `tar_progress()`
#' only returns progress information on these targets.
#' You can supply symbols
#' or `tidyselect` helpers like [all_of()] and [starts_with()].
#' or `tidyselect` helpers like [any_of()] and [starts_with()].
#' @param fields Optional, names of progress data columns to read.
#' Set to `NULL` to read all fields.
#' @examples
Expand All @@ -33,7 +33,7 @@
#' }, ask = FALSE)
#' tar_make()
#' tar_progress()
#' tar_progress(starts_with("y_")) # see also all_of()
#' tar_progress(starts_with("y_")) # see also any_of()
#' })
#' }
tar_progress <- function(
Expand Down
4 changes: 2 additions & 2 deletions R/tar_sitrep.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#' @param fields Optional, names of columns/fields to select. If supplied,
#' `tar_sitrep()` only returns the selected metadata columns.
#' You can supply symbols or `tidyselect` helpers
#' like [all_of()] and [starts_with()].
#' like [any_of()] and [starts_with()].
#' The `name` column is always included first
#' no matter what you select. Choices:
#' * `name`: name of the target or global object.
Expand Down Expand Up @@ -87,7 +87,7 @@
#' }, ask = FALSE)
#' tar_make()
#' tar_sitrep()
#' tar_meta(starts_with("y_")) # see also all_of()
#' tar_meta(starts_with("y_")) # see also any_of()
#' })
#' }
tar_sitrep <- function(
Expand Down
4 changes: 2 additions & 2 deletions R/tar_skipped.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' @param names Optional, names of the targets. If supplied, the
#' function restricts its output to these targets.
#' You can supply symbols
#' or `tidyselect` helpers like [all_of()] and [starts_with()].
#' or `tidyselect` helpers like [any_of()] and [starts_with()].
#' @examples
#' if (identical(Sys.getenv("TAR_EXAMPLES"), "true")) {
#' tar_dir({ # tar_dir() runs code from a temporary directory.
Expand All @@ -19,7 +19,7 @@
#' }, ask = FALSE)
#' tar_make()
#' tar_skipped()
#' tar_skipped(starts_with("y_")) # see also all_of()
#' tar_skipped(starts_with("y_")) # see also any_of()
#' })
#' }
tar_skipped <- function(
Expand Down
4 changes: 2 additions & 2 deletions R/tar_started.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' @param names Optional, names of the targets. If supplied, the
#' function restricts its output to these targets.
#' You can supply symbols
#' or `tidyselect` helpers like [all_of()] and [starts_with()].
#' or `tidyselect` helpers like [any_of()] and [starts_with()].
#' @examples
#' if (identical(Sys.getenv("TAR_EXAMPLES"), "true")) {
#' tar_dir({ # tar_dir() runs code from a temporary directory.
Expand All @@ -19,7 +19,7 @@
#' }, ask = FALSE)
#' tar_make()
#' tar_started()
#' tar_started(starts_with("y_")) # see also all_of()
#' tar_started(starts_with("y_")) # see also any_of()
#' })
#' }
tar_started <- function(
Expand Down
2 changes: 1 addition & 1 deletion R/tar_visnetwork.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#' )
#' })
#' tar_visnetwork()
#' tar_visnetwork(allow = starts_with("y")) # see also all_of()
#' tar_visnetwork(allow = starts_with("y")) # see also any_of()
#' })
#' }
tar_visnetwork <- function(
Expand Down
2 changes: 1 addition & 1 deletion R/tar_watch_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ tar_watch_server <- function(
out <- tar_progress(fields = everything(), store = path_store)
if (tar_exist_meta(store = path_store)) {
fields <- c("name", "time", "seconds", "bytes", "error", "warnings")
meta <- tar_meta(fields = all_of(fields), store = path_store)
meta <- tar_meta(fields = any_of(fields), store = path_store)
meta$finished <- as.character(meta$time)
meta$time <- units_seconds(meta$seconds)
meta$size <- units_bytes(meta$bytes)
Expand Down
4 changes: 2 additions & 2 deletions man/tar_built.Rd

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

4 changes: 2 additions & 2 deletions man/tar_canceled.Rd

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

2 changes: 1 addition & 1 deletion man/tar_delete.Rd

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

4 changes: 2 additions & 2 deletions man/tar_errored.Rd

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

Loading

0 comments on commit d17889f

Please sign in to comment.