且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

终端中的 R 语法高亮显示

更新时间:2022-12-11 17:04:22

我终于找到了一个满足我需求的库.
现在我对我的编码环境更满意了.

I've finally found a library that meets my needs.
Now I'm much happier with my coding environment.

colorout 是一个 R 包,它在终端模拟器中运行时对 R 输出进行着色.该包不能被在 CRAN 上,因为它更改了 R 已经加载的代码,这是 CRAN 存储库策略禁止的.该包替换了将结果和消息输出到 R 控制台的函数,这是必要的,因为我们无法在不替换这些函数的情况下为输出着色.要安装它,请在 R 中执行以下操作:

colorout is an R package that colorizes R output when running in a terminal emulator.The package cannot be on CRAN because it changes code already loaded by R and this is prohibited by the CRAN Repository Policy. The package replaces the functions that output results and messages to R Console, and this is necessary because we cannot colorize the output without replacing these functions. To install it, do the following in R:

install.packages("devtools")
devtools::install_github("jalvesaq/colorout")
library("colorout")
# do something