简体   繁体   中英

Can't load library R Studio

I am trying to install the ggmap library:

 install.packages("ggmap")
 library(ggmap)

This is what I get though:

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’

It used to work, then I don't know what happened and it stopped working. Any ideas ? I tried removing the package then installing it again but it still doesn't work

Next time when installing packages, try this:

install.packages("ggmap",dependencies=TRUE)
library(ggmap)

The extra argument will make sure all the necessary dependencies are also installed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM