加载ggplot2包,缺少' munsell'包

时间:2014-10-26 04:09:26

标签: r

我正在尝试加载ggplot2。我正在使用Windows 7.R告诉我ggplot2已成功加载,但当我尝试使用library函数时,它说它无法找到ggplot2。这就是它所说的。

install.packages("ggplot2")
Installing package into ‘C:/Users/Owner/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.1/ggplot2_1.0.0.zip'
Content type 'application/zip' length 2675581 bytes (2.6 Mb)
opened URL
downloaded 2.6 Mb

package ‘ggplot2’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\Owner\AppData\Local\Temp\RtmpyesS1j\downloaded_packages

然后我尝试使用library函数并收到此消息:

library("ggplot2")
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  there is no package called ‘munsell’
Error: package or namespace load failed for ‘ggplot2’
> head(diamonds)
Error in head(diamonds) : object 'diamonds' not found

我希望有人知道我做错了什么。

1 个答案:

答案 0 :(得分:4)

应该执行此操作:

install.packages("ggplot2", dependencies=TRUE)