invisible {base} | R Documentation |
Change the Print Mode to Invisible
Description
Return a (temporarily) invisible copy of an object.
Usage
invisible(x = NULL)
Arguments
x |
an arbitrary R object, by default |
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.
References
Becker RA, Chambers JM, Wilks AR (1988). The New S Language. Chapman and Hall/CRC, London.
See Also
withVisible
,
return
,
function
.
Examples
# These functions both return their argument
f1 <- function(x) x
f2 <- function(x) invisible(x)
f1(1) # prints
f2(1) # does not
[Package base version 4.6.0 Index]