[英]Unused argument error with ggplot position_dodge(preserve = “single”)
尝试对ggplot文档中此处描述的position_dodge()使用保持参数时遇到错误。
ggplot(
mtcars,
aes(
factor(cyl),
fill = factor(vs)
)
) +
geom_bar(position = position_dodge(preserve = "single"))
position_dodge(preserve =“ single”)中的错误:未使用的参数(preserve =“ single”)
我正在使用R版本3.4.1和ggplot2版本2.2.1
有什么建议么? 谢谢
它看起来像preserve
参数存在于开发版ggplot2
但目前只在功能position_dodge2()
而不是在正常position_dodge()
函数。 该链接显示了我如何找到该信息的: https : //github.com/tidyverse/ggplot2/search?utf8=%E2%9C%93&q=preserve&type=
我尚不清楚为什么在线文档( http://ggplot2.tidyverse.org/reference/index.html )显示preserve
为当前可用的功能。
如果您确实要使用此功能,则可以尝试安装开发版本。 我不知道那是否是个好主意!
install.packages("devtools")
library(devtools)
devtools::install_github("tidyverse/ggplot2")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.