library(ggmap)
library(dplyr)
df <- read.csv("../data/processed/bikethefts.csv")
Longitude and latitude of Cambridge
myLocation <- c(lon = 0.1218, lat = 52.2053)
get map using get_map and plot using ggmap(). Level of zoom can be set with zoom, with higher numbers being more zoomed.
get_map(location=myLocation, zoom = 15) %>% ggmap() +
geom_point(data = df, aes(x = Longitude, y = Latitude), color = 'red', size = 1)
Source : https://maps.googleapis.com/maps/api/staticmap?center=52.2053,0.1218&zoom=15&size=640x640&scale=2&maptype=terrain&language=en-EN Warning message: “Removed 2963 rows containing missing values (geom_point).”
get_map(location=myLocation, zoom = 13) %>% ggmap() +
geom_point(data = df, aes(x = Longitude, y = Latitude), color = 'red', size = 1)
Source : https://maps.googleapis.com/maps/api/staticmap?center=52.2053,0.1218&zoom=13&size=640x640&scale=2&maptype=terrain&language=en-EN Warning message: “Removed 1695 rows containing missing values (geom_point).”