ID EN
Miscellaneous

invisible

R Base 3.6.2

Return a (temporarily) invisible copy of an object.

Syntax

R
invisible(x)

Arguments

Parameter Description
x an arbitrary R object.

Details

This function can be useful when it is desired to have functions return values which can be assigned, but which do not print when they are not assigned. This is a primitive function.

Examples

Example
R
# NOT RUN {
# These functions both return their argument
f1 <- function(x) x
f2 <- function(x) invisible(x)
f1(1)  # prints
f2(1)  # does not
# }

See Also

withVisible return function.