Better exists()

better_exists(
  x,
  where = -1,
  mode = "any",
  inherits = TRUE,
  verbose = FALSE,
  ...
)

Arguments

x

character vector length 1 or more, indicating the object names, with or without package prefix.

where, mode, inherits

arguments passed to base::exists(). Note that arguments envir and frame use the defaults, and therefore may not be compatible with using input x with more than one value.

...

additional arguments are passed to base::exists().

#' @examples exists("exists", where="package:base")

better_exists("base::exists")

Value

logical vector with length equal to length(x). Note that when a package prefix is supplied, when the package is not on the search path this function returns FALSE, and does not throw an error.