我正在尝试在我的数据上使用facet_wrap,但它会产生以下错误:
Error in UseMethod("absolute.units") :
no applicable method for 'absolute.units' applied to an object of class "c('unit.arithmetic', 'unit')"
我的数据集或代码不是问题,因为我过去成功运行过此代码。我从手册中运行了测试代码:
ggplot(mpg, aes(displ, hwy)) +
geom_point() +
facet_wrap(~class)
它产生了同样的错误。我更新了ggplot2包,但错误仍然存在。以下是会话信息的输出:
sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.12.6 (unknown)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggplot2_2.2.1.9000
loaded via a namespace (and not attached):
[1] labeling_0.3 colorspace_1.3-2 scales_0.5.0 lazyeval_0.2.0 plyr_1.8.4 tools_3.2.2
[7] gtable_0.2.0 tibble_1.3.4 Rcpp_0.12.12 grid_3.2.2 rlang_0.1.2 munsell_0.4.3
我试过没有运气的谷歌搜索错误。有没有人遇到此错误或知道如何解决它?感谢