终端中的 R 语法高亮显示 [英] R syntax highlighting in Terminal

查看:35
本文介绍了终端中的 R 语法高亮显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以在终端中获得 R 的语法高亮吗?

Can we get syntax highlighting for R in the Terminal?

推荐答案

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

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

这篇关于终端中的 R 语法高亮显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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