在尝试修改主题设置时,这个简单的代码会出现以下错误:
library(ggplot2)
theme_nogrid <- theme_set(theme_update(
plot.margin=unit(c(.25, .25, .25, .25), "in"),))
Error in do.call(theme, list(...)) : could not find function "unit"
Run Code Online (Sandbox Code Playgroud)
R给了我使用'unit'的任何元素的这个错误.任何其他不称为"单位"的设置都可以正常工作.我正在运行R v.2.15.2(64位Windows).
我在网上广泛搜索了这个问题,一无所获.我感谢对此问题的任何建议.