我正在尝试安装ggmap库:
install.packages("ggmap")
library(ggmap)
这是我得到的:
Installing package into ‘my path’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/ggmap_2.6.1.zip'
Content type 'application/zip' length 4563151 bytes (4.4 MB)
downloaded 4.4 MB
package ‘ggmap’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
my path
> library(ggmap)
Error: package or namespace load failed for ‘ggmap’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘maps’
它曾经工作,然后我不知道发生了什么,它停止了工作。有任何想法吗 ?我尝试删除包然后重新安装它,但它仍然无法正常工作
答案 0 :(得分:1)
下次安装软件包时,请尝试以下方法:
install.packages("ggmap",dependencies=TRUE)
library(ggmap)
额外的参数将确保还安装了所有必需的依赖项。