Invisible() Function in R
Last Updated :
02 Jun, 2022
The invisible() function in R Programming Language is used to make the printing statements invisible which means the printing statements will not appear.
Syntax:
invisible(data)
where data is the input data structure/variable.
Example 1:
In this example, we are going to create two vectors and display them both with and without invisible in the R programming language.
R
vec1 = c (1, 2, 3, 4, 5)
vec2 = c (56, 5, 5)
vec2
invisible (vec2)
vec1
invisible (vec1)
|
Output:
[1] 56 5 5
[1] 1 2 3 4 5
Example 2:
In this example, we are going to create two variables and display both with and without invisible in the R programming language.
R
a = 45
b = 77
a
invisible (a)
b
invisible (b)
|
Output:
[1] 45
[1] 77
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...