check-vector-isExisting: Does the requested input exist in the environment?

check-vector-isExistingR Documentation

Does the requested input exist in the environment?

Description

Does the requested input exist in the environment?

Usage

isExisting(x, envir = parent.frame(), inherits = FALSE)

isNonExisting(x, envir = parent.frame(), inherits = FALSE)

allAreExisting(x, envir = parent.frame(), inherits = FALSE)

allAreNonExisting(x, envir = parent.frame(), inherits = FALSE)

Arguments

x

character. Variable names to check in environment.

envir

environment. Environment.

inherits

logical(1). Should the enclosing frames of the environment be searched?

Value

TRUE on success; FALSE on failure, with cause set.

Functions

  • isExisting(): Vectorized.

  • isNonExisting(): Vectorized.

  • allAreExisting(): Scalar.

  • allAreNonExisting(): Scalar.

Note

exists() only supports character(1), so we are exporting isExisting() as a convenience function to check multiple variables in a single call.

Updated 2023-10-02.

See Also

assertive.code::is_existing().

Examples

a <- 1L
b <- 2L

## TRUE ====
isExisting(c("a", "b"))
allAreNonExisting(c("x", "y"))

## FALSE ====
isExisting(c("x", "y"))

acidgenomics/goalie documentation built on Dec. 11, 2023, 11:36 p.m.