作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想在 R 启动时更改调色板。因此我将以下源代码复制到我的 .Rprofile
palette(c(
"#2e3436" # (Aluminium 6)
, "#ef2929" # (Scarlet Red 1)
, "#73d216" # (Chameleon 2)
, "#3465a4" # (Sky Blue 2)
, "#fcaf3e" # (Orange 1)
, "#ad7fa8" # (Plum 1)
, "#babdb6" # (Butter 1)
, "#babdb6" # (Aluminium 3)
))
启动 R 时会显示以下消息:
Error: Could not fine the function 'palette'
是否无法在启动时更改调色板?
最佳答案
来自 ?Startup
Note that when the site and user profile files are sourced only the 'base' package is loaded, so objects in other packages need to be referred to by e.g. 'utils::dump.frames' or after explicitly loading the package concerned.
因此调用 grDevices::palette()
而不是 palette()
。 (需要调用 dev.off()
来消除启动后出现的空白图形窗口。)
grDevices::palette(c(
"#2e3436" # (Aluminium 6)
, "#ef2929" # (Scarlet Red 1)
, "#73d216" # (Chameleon 2)
, "#3465a4" # (Sky Blue 2)
, "#fcaf3e" # (Orange 1)
, "#ad7fa8" # (Plum 1)
, "#babdb6" # (Butter 1)
, "#babdb6" # (Aluminium 3)
))
grDevices::dev.off()
关于r - 如何在 .Rprofile 中设置调色板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20707940/
我是一名优秀的程序员,十分优秀!