Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Function to clear the console in R and RStudio

Tags:

r

I am wondering if there is a function to clear the console in R and, in particular, RStudio I am looking for a function that I can type into the console, and not a keyboard shortcut.

Someone has already provided such a function in this StackExchange post from 2010. Unfortunately, this depends on the RCom package and will not run on Mac OS X.

like image 906
Berk U. Avatar asked Jan 10 '13 14:01

Berk U.


People also ask

How do I clear my console in RStudio?

Ctrl+L — Clear the Console.

How do I clear the console in R on a Mac?

How to clear the R console on a Mac. For those using an Apple Mac device, you should continue reading because things are a bit different compared to Windows. Via key combinations: From within R, please press Options + Command + L, and that should be it for clearing the console.

How do you clear the console?

Use the short cut Ctrl + L to clear the console.

How do you clear an object in R?

rm() function in R Language is used to delete objects from the memory. It can be used with ls() function to delete all objects. remove() function is also similar to rm() function.


1 Answers

cat("\014")   

is the code to send CTRL+L to the console, and therefore will clear the screen.

Far better than just sending a whole lot of returns.

like image 51
E Luxo So Avatar answered Oct 10 '22 15:10

E Luxo So