I'm doing relatively simple things with ggmap and am confused because code that runs fine on my mac does not run on my PC.
I run this code:
library(ggmap)
map <- get_map(location = c(-122.175, 37.45635),
maptype = "terrain",
source = "google",
crop = FALSE,
zoom = 7)
ggmap(map)
, which runs fine on my mac, but throws this error on my PC:
Error in as.vector(y) : attempt to apply non-function
Any help would be much appreciated.
It is no longer necessary to uninstall ggplot2 to fix this error. I was able to update ggplot by running install.packages("ggplot2"), then reinstall ggmap. This solved the problem for me.
I faced that problem after installing R and RStudio last week. Restarting RStudio or R session, or reinstalling ggmap package didn't work for me. I'd just fixed it with these steps:
I guess this problem comes from the last update of ggplot2. See the following links:
You could try to install an older version of ggplot (see below) or try to reinstall the packages like suggested in the link above.
library(devtools)
install_version("ggplot2", version = "2.1.0", repos = "http://cran.us.r-project.org")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With