Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
5 views
in R Programming by (4k points)
recategorized by
I want a function to clear the console in R and RStudio instead of a keyboard function, Can someone tell me any?

2 Answers

0 votes
by
edited by

You can use the following functions to clear the console in RStudio:

cat("\f")

cat("\014")

Both of these functions send CTRL + L to the console which is the keyboard shortcut used to clear the console.

0 votes
by (32.3k points)
edited by

You may define the following function

clc <- function() cat(rep("\n", 50))

which you can then call as clc().

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...