withVisible

0th

Percentile

Return both a Value and its Visibility

This function evaluates an expression, returning it in a two element list containing its value and a flag showing whether it would automatically print.

Keywords
programming
Usage
withVisible(x)
Arguments
x

an expression to be evaluated.

Details

The argument, not an expression object, rather an (unevaluated function) call, is evaluated in the caller's context.

This is a primitive function.

Value

value

The value of x after evaluation.

visible

logical; whether the value would auto-print.

See Also

invisible, eval; withAutoprint() calls source() which itself uses withVisible() in order to correctly “auto print”.

Aliases
  • withVisible
Examples
library(base) # NOT RUN { x <- 1 withVisible(x <- 1) # *$visible is FALSE x withVisible(x) # *$visible is TRUE # Wrap the call in evalq() for special handling df <- data.frame(a = 1:5, b = 1:5) evalq(withVisible(a + b), envir = df) # }
Documentation reproduced from package base, version 3.6.1, License: Part of R 3.6.1

Community examples

Looks like there are no examples yet.