R ggmap Error: object 'f' not found
Asked Answered
H

6

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!

Hausmann answered 27/1, 2017 at 4:26 Comment(5)
@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)Gibeonite
Code works fine for me. Close R, reopen and try again. Then load extra libraries one by one and test after eachFiann
This is just a simple example that you don't need any data. @bethanyPHausmann
I even reinstall R, R studio and all packages, it still shows the error. @RichardTelfordHausmann
I just ran it too...it loads a map fine..Incorporation
F
5

Reverting to ggplot v. 2.2.0 worked for me: devtools::install_github("hadley/[email protected]")

Formulaic answered 13/3, 2017 at 17:14 Comment(0)
P
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.

Proscription answered 13/2, 2017 at 11:42 Comment(1)
This is the best answer for most cases. Dont' revert to older versions, just update both ggmap and ggplot to their newest releases on githubSubteen
V
1

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

Vivle answered 28/4, 2017 at 6:38 Comment(0)
H
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

Hausmann answered 27/1, 2017 at 21:17 Comment(0)
H
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.

Hayden answered 28/1, 2017 at 18:7 Comment(0)
S
0

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

Specie answered 30/1, 2017 at 20:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.