FAQ Database Discussion Community


ggmap route finding - doesn't stay on roads

r,ggmap
I am trying to map a route using the route() function in ggmap. My problem is that the route doesn't stay on the roads. Is there something that my route_df <- route(origin, destination, structure = "route") code is missing? Or is there an alternative function that can be used to...

Plotting GPS coordinates using ggmap

r,ggplot2,gps,ggmap
I am attempting to create a plot of gps coordinates on a map in R using ggmap. Here is the first 10 rows of the dataset I am using: gps[1:10,] X_id lon timestamp lat 1 5555bcda65bc7d0f2c8d1a9c -4.018623 2015-05-15T09:31:06.859Z 53.23945 2 5555bcdb65bc7d0f2c8d1a9f -4.018623 2015-05-15T09:31:07.371Z 53.23945 3 5555bcdb65bc7d0f2c8d1aa2 -4.018623 2015-05-15T09:31:07.868Z 53.23945 4...

R shiny. Error pops up while using ggmap

r,ggplot2,shiny,ggmap
I have a dataset with latitude and longitude place latitude longitude w 28.844692 77.103305 x 28.750925 77.1963099 y 28.702134 77.2202666 z 28.716547 77.1704 I've tried the code below and it is working fine: a <- coordinates[coordinates$place=="y",c("place","latitude","longitude")] get_constituency <- get_map(c(a$longitude, a$latitude)) ggmap(get_constituency) + geom_point(aes(x = a$longitude, y = a$latitude, size=10), alpha...

R: ggmap: containing missing values (geom_point) when plottinng but no NAs values found in data.frame

r,ggmap
I'm plotting some points over a map with ggmap package. The problem is that i get the message: "Removed 12 rows containing missing values (geom_point)". But i don't have any NAs. I've looked the data, and used: sum(is.na(limanov2)) #Gives 0 to prove it. This is my code: library(maps) library(ggmap) lima...

how to handle error from geocode (ggmap R)

r,google-geocoder,ggmap
I'm using ggmap to find locations. Some locations generates error. For example, library(ggmap) loc = 'Blue Grass Airport' geocode(loc, output = c("more")) results in Error in data.frame(long_name = "Blue Grass Airport", short_name = "Blue Grass Airport", : arguments imply differing number of rows: 1, 0 It's ok if I can't...

gmmap with zoom=1 not displaying

r,ggmap
I am trying to plot a world map using zoom=1 in the code below and it is not displaying, but when I put any other zoom number (for example 4) it is working perfectly... Any idea why it is not working with zoom=1? library(ggmap) map <- qmap('world', zoom = 1)...

R stops displaying maps

r,google-maps,ggmap
Few days ago I was familiarizing myself with displaying maps, plotting points on the map from http://rpubs.com/nickbearman/r-google-map-making Today, I have intermittent success in displaying maps. library(ggmap) map <- qmap('Anaheim', zoom = 10, maptype = 'roadmap') Outputs Map from URL : http://maps.googleapis.com/maps/api/staticmap?center=Anaheim&zoom=10&size=640x640&scale=2&maptype=roadmap&language=en-EN&sensor=false And when I go to the URL...

Binning longitude/latitude labeled data by census block ID

r,ggplot2,gis,ggmap,binning
I have two data sets, one for crime in Chicago, labeled with longitude and latitude coords and a shapefile of census blocks also in Chicago. Is it possible in R to aggregate crimes within census blocks, given these two files? The purpose is to be able to map out the...

get bounding box from ggmap object

r,ggmap
I'm using ggmap library in R. I'm trying to download a rectangular map with it, but I know it'll give me a square. I only need the bounding box of the returned square. library(ggmap) map <- get_map(c(-65.7,-3.1,-64.4,-2.3),maptype="satellite",filename="map.png") str(map) chr [1:1280, 1:1280] "#294829" "#294829" "#2D512D" "#264425" ... - attr(*, "class")= chr...

How to plot data points at particular location in a map in R

r,google-maps,ggmap
I have a dataset that looks like this: LOCALITY numbers 1 Airoli 72 2 Andheri East 286 3 Andheri west 208 4 Arya Nagar 5 5 Asalfa 7 6 Bandra East 36 7 Bandra West 72 I want to plot bubbles (bigger the number bigger would be the bubble) inside...

Dynamic data point label Positioning in ggmap

r,ggplot2,ggmap
I'm working with the ggmap package in R and I am relatively new to geospatial data visualizations. I have a data frame of eleven latitude and longitude pairs that I would like to plot on a map, each with a label. Here is the dummy data: lat<- c(47.597157,47.656322,47.685928,47.752365,47.689297,47.628128,47.627071,47.586349,47.512684,47.571232,47.562283) lon<-c(-122.312187,-122.318039,-122.31472,-122.345345,-122.377045,-122.370117,-122.368462,-122.331734,-122.294395,-122.33606,-122.379745) labels<-c("Site...

Plotting in R 3.1.2 [closed]

r,plot,ggplot2,ggmap
I have records of data by account (say unique 400 records). Each record has three different indications indicated premium. For each record, I am concerned with how the indications compare to each other. In some cases, the indications may be all relatively in line, while in other the 3 indications...

How do I plot US cities using ggplot?

r,ggplot2,ggmap
I can plot the state of Louisiana just fine... require(ggplot2) require(ggmap) require(maps) LA <- map_data("state", region="louisiana") ggplot(LA, aes(x=long, y=lat))+geom_polygon() Now, I have data on how many sales calls were made to particular cities in LA. How would I add a point for each city where a sales call was made...