Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in R Programming by (5.3k points)
edited by

I'm looking to suppress the output of one command (in this case, the apply function).

Is it possible to do this without using sink()? I've found the described solution below but would like to do this in one line if possible.

1 Answer

0 votes
by
edited by

To suppress the output of any command, apart from the sink() function, you can use the invisible() function as follows:

apply(matrix(1:10), 1, as.numeric)

 [1]  1  2  3  4  5  6  7  8  9 10

invisible(apply(matrix(1:10), 1, as.numeric))

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...