Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to suppress output in RStudio?

I need to suppress my output when I run my R scripts in RStudio. There are a lot of comments in my scripts, and the comments are printed when I run the file.

I realize that others have asked how to do this from the command prompt - How to suppress output. I'm not interested in that.

I just want to know how to suppress the output in RStudio. The only exception to this should be print statements. Thanks in advance.

like image 781
makansij Avatar asked Jan 22 '15 19:01

makansij


People also ask

How do I not show console in R markdown?

Console Hiding If you prefer not to have the console hidden when chunks are executed, uncheck Tools -> Global Options -> R Markdown -> Hide console automatically when executing notebook chunks.

How do I view output in R studio?

Rendering output Better still, use the “Knit” button in the RStudio IDE to render the file and preview the output with a single click or keyboard shortcut (⇧⌘K).

Can you save console output in R?

You can also save the entire R console screen within the GUI by clicking on "Save to File..." under the menu "File." This saves the commands and the output to a text file, exactly as you see them on the screen.

What character is used to suppress the output of a command in Scilab?

6. When do you think it is useful to use the semicolon (;) to suppress the output of a Scilab statement? 7.


2 Answers

Use source instead of source with echo in R Studio. Source in RStudio

Same in MAC.

enter image description here

like image 179
Atilla Ozgur Avatar answered Oct 28 '22 21:10

Atilla Ozgur


Ctrl+Shift+S will do the trick. In mac, it will be Shift+Command+S.

like image 3
TYL Avatar answered Oct 28 '22 20:10

TYL