I am trying to use my lat-log data to plot over google maps. For that I tried to download the google maps and then use it for plotting the values.
Here's how I tried to download but I couldn't understand the function properly:
Let's say:
data.lat.long <- data.frame(lat=c(2,3,4,5,6,7,3,7,8,9,2),long=c(3,7,8,9,2,1,2,3,4,5,6),C=c(1,1,1,2,2,1,1,1,1,2,2))
data <- data.lat.long %>% mutate(mean_lat = mean(Latitude)) %>% mutate(mean_long = mean(Longitude))
library(RgoogleMaps)
GetMap(center = c(lat = data$meanlatitude, lon = data$meanlongitude),
size = c(640, 640), destfile = "C:/m/googlemaps/", zoom = 12,
sensor = "true", maptype = c("terrain"),format = c("gif"),
RETURNIMAGE = TRUE, GRAYSCALE = FALSE, NEWMAP = TRUE, SCALE = 1,
API_console_key = NULL, verbose = 0)
what I am trying to do is: I have calculated max and min lat-long points. And I want to download that region only [from maximum latitude to minimum latitude & maximum longitude to minimum longitude].