5

After I install rnoaa packages, my ggmap package is not working. I couldn't even do the simple example:

>library(ggmap)

>qmap(location = "boston university")

Error in get("f", environment(CoordMap$train)) : object 'f' not found

Does anyone have the same problem? Thank you!

www
  • 38,575
  • 12
  • 48
  • 84
Minchun Zhou
  • 51
  • 1
  • 4
  • 1
    @bethanyP I did reproduce the error with those 2 lines of code, although I'm unclear as to why it's happening. Even the following example from the `ggmap` help page for the `get_map` function doesn't work: `map <- get_map(location = "texas", zoom = 6, source = "stamen")`. `ggmap(map, fullpage = TRUE)` – Phil Jan 27 '17 at 06:16
  • 1
    Code works fine for me. Close R, reopen and try again. Then load extra libraries one by one and test after each – Richard Telford Jan 27 '17 at 06:50
  • 1
    This is just a simple example that you don't need any data. @bethanyP – Minchun Zhou Jan 27 '17 at 16:22
  • I even reinstall R, R studio and all packages, it still shows the error. @RichardTelford – Minchun Zhou Jan 27 '17 at 16:26
  • I just ran it too...it loads a map fine.. – sconfluentus Jan 27 '17 at 16:54

6 Answers6

5

Reverting to ggplot v. 2.2.0 worked for me: devtools::install_github("hadley/ggplot2@v2.2.0")

mlevy
  • 315
  • 2
  • 12
1
  1. Reinstall R and R Studio
  2. Library(devtools) devtools::install_github("dkahle/ggmap") devtools::install_github("hadley/ggplot2")

Had the same error, and works fine now.

Chrisftw
  • 119
  • 1
  • 8
  • This is the best answer for most cases. Dont' revert to older versions, just update both ggmap and ggplot to their newest releases on github – HAVB Feb 16 '18 at 17:38
1

I had this problem as well, uninstalling ggplot2 and reinstalling it from CRAN worked for me.

MarMar
  • 180
  • 2
  • 8
0

My colleague fix this problem by installing the old version of ggmap. ggmap updated on 2016-01-23. The old version from 2015-12-19 works fine. For those who have the same problem, go to link below and download the old version of ggmap. It should fix the problem.

https://cran.r-project.org/web/packages/ggmap/index.html

Minchun Zhou
  • 51
  • 1
  • 4
0

I also had the problem with ggmap not working. Using the CRAN package "version", I saw that my installed version was 2.6.1, claimed by CRAN to be the latest version. But on GitHub I discovered version 2.7, downloaded it with devtools, and now my code is working.

damonzon
  • 1
  • 1
0

You can go to this link and reinstall the packages again.It should solve the problem.

Community
  • 1
  • 1
Frankie
  • 61
  • 3