在 R 和 RStudio 中清除控制台的功能 [英] Function to clear the console in R and RStudio

查看:42
本文介绍了在 R 和 RStudio 中清除控制台的功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道 R 中是否有清除控制台的功能,特别是 RStudio 我正在寻找可以在控制台中输入的功能,而不是键盘快捷键.

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.

有人已经在 2010 年的 StackExchange 帖子中提供了这样的功能.不幸的是,这取决于 RCom 包,不能在 Mac OS X 上运行.

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.

推荐答案

cat("\014")  

是将 CTRL+L 发送到控制台的代码,因此将清除屏幕.

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.

这篇关于在 R 和 RStudio 中清除控制台的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆