加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

windows – 以编程方式在R Console中设置字体和字体大小?

发布时间:2020-12-14 02:01:02 所属栏目:Windows 来源:网络整理
导读:是否可以通过编程方式设置 console font and font size,就像设置“Edit- GUI首选项”一样?这个功能怎么样?我在窗户上. 解决方法 在Windows(至少)上,$R_HOME / etc / Rconsole配置文件为控制台和寻呼机设置了许多可选参数.以下是您可以手动编辑以更改默认字
是否可以通过编程方式设置 console font and font size,就像设置“Edit-> GUI首选项”一样?这个功能怎么样?我在窗户上.

解决方法

在Windows(至少)上,$R_HOME / etc / Rconsole配置文件为控制台和寻呼机设置了许多可选参数.以下是您可以手动编辑以更改默认字体和字体大小的部分:

## Font.
# Please use only fixed width font.
# If font=FixedFont the system fixed font is used; in this case
# points and style are ignored. If font begins with "TT ",only
# True Type fonts are searched for.
font = TT Courier New
points = 10
style = normal # Style can be normal,bold,italic

要从活动R会话的命令行更改值,可以使用loadRconsole()函数.它读入包含上面所示形式的指令的文本文件,该文件将覆盖启动R时从Rconsole读取的值.这是一个例子:

temp <- tempfile()
cat("points = 13n",file = temp)
cat("style = italicn",file = temp,append = TRUE)
loadRconsole(file = temp)

## And then,to reset to the defaults:
loadRconsole(file = file.path(R.home(),"etc/Rconsole"))

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读