问题
I am trying to plot some GPS locations on a map. I used "ggmap" library for this. While using ggmap command, I get below error-
ggmap(mp)
Error: is.integer(group) is not TRUE
Here is code snippet:
library(ggplot2)
library(ggmap)
mapgilbert = get_map(location = (Long=mean(as.numeric(datn$Long)),Lat=mean(as.numeric(datn$Lat))), zoom = 4,maptype = "satellite", scale = 2)
ggmap(mapgilbert)
Note : "datn" is data frame containing GPS locations in columns Lat and Long.
I tried using locations like "paris","texas" etc as given in R help (
map <- get_map(location = "texas", zoom = 6, source = "stamen")
ggmap(map, fullpage = TRUE))
but it didn't help. Still getting same error after ggmap command.
回答1:
I upgraded ggplot2,ggmap and plyr. It solved the problem
来源:https://stackoverflow.com/questions/40762729/error-is-integergroup-is-not-true-while-using-ggmap-in-r