I have been trying to get the following dataset to map using ggmap and ggplot2 combination.
my dataframe -> head(dt.fil) containing 855 values
lat lon airline
1 -73.9930 40.7480 Virgin America
2 -71.0200 42.3610 Virgin America
3 -118.4062 33.9454 Virgin America
4 -118.4041 33.9421 Virgin America
5 -96.9322 33.2145 US Airways
6 -118.3859 34.0220 United
my code is the following
map_airlines <- get_map(location = c(lon = mean(dt.fil$lon),
lat = mean(dt.fil$lat)), zoom = 5,
maptype = "satellite", scale = 2)
# visualze the tweet locations
ggmap(map_airlines) +
geom_point(data=dt.fil, aes(x=lon, y=lat, fill='red',
alpha=0.6, colour=airline)) +
guides(fill=FALSE, alpha=FALSE)
I get the following errors
Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
3: In min(x) : no non-missing arguments to min; returning Inf
4: In max(x) : no non-missing arguments to max; returning -Inf
5: Removed 835 rows containing missing values (geom_point).
I would really appreciate if somebody could help me with this :)
fill='red'
andalpha=0.6
outside ofaes()
. – jazzurro