以下代码工作正常:
library(ggfortify)
autoplot(lm(Petal.Width ~ Petal.Length, data = iris), label.size = 3)
但是ggfortify::autoplot
,ggfortify:::autoplot
并没有按预期工作。请参阅下面的错误代码:
ggfortify::autoplot(lm(Petal.Width ~ Petal.Length, data = iris), label.size = 3)
错误:“autoplot”不是从“命名空间:ggfortify”导出的对象
ggfortify:::autoplot(lm(Petal.Width ~ Petal.Length, data = iris), label.size = 3)
获取错误(名称,envir = asNamespace(pkg),继承 = FALSE):
找不到对象'autoplot'
想知道我在这里缺少什么。提前感谢您的帮助。
sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: i686-pc-linux-gnu (32-bit)
Running under: Ubuntu 16.04.1 LTS
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggfortify_0.3.0.9000 ggplot2_2.2.0
loaded via a namespace (and not attached):
[1] Rcpp_0.12.8 tidyr_0.6.0 dplyr_0.5.0 assertthat_0.1 grid_3.3.2
[6] plyr_1.8.4 R6_2.2.0 gtable_0.2.0 DBI_0.5-1 magrittr_1.5
[11] scales_0.4.1 lazyeval_0.2.0 labeling_0.3 tools_3.3.2 munsell_0.4.3
[16] colorspace_1.3-1 gridExtra_2.2.1 tibble_1.2