1

I'm trying to plot the locations of restaurants in NYC onto the plot of NYC boroughs that I made from the shapefile provided by the NYC Taxi Data website using Rstudio. I don't understand why it is plotting the points of the restaurant locations wrong.

aoi_boundary = the shapefile provided by the NYC Taxi data website. (https://www1.nyc.gov/site/tlc/about/tlc-trip-record-data.page) rest_list = the list of restaurants with columns with the longitude and latitude coordinates where the restaurant is located

This is what I've attempted along with the attached result:

aoi_boundary_HARV <- st_read("/Users/rodrigotrujillo/Documents/College/Fall 2019/STAT 405/Project/taxi_zones/taxi_zones.shp")

ggplot(data = aoi_boundary_HARV) + theme_bw() + 
  geom_sf(size = .2, color = "black", fill = NA) +
  ggtitle("Yearly Pickup Location Density Map") + 
  coord_sf() +
  geom_point(data = rest_list, 
             aes(x = Longitude, y = Latitude, color = GRADE,
                 size = 2))

enter image description here

  • You've not shown us anything about the restaurant data apart from one blue dot in the wrong place. Where did you get the data from? How did you read it in? What do the first few rows look like? Please edit your question and supply some more information. – Spacedman Dec 5 '19 at 8:29
  • 1
    My guess is that both layers are using a state plane zone but one is defined with feet and the other with meters but the restaurant locations (blue dot) was defined with the incorrect units. – mkennedy Dec 5 '19 at 18:47
  • Another possibility is that the points are really latitude-longitude but the coordinate reference system is set to a state plane zone by mistake. – mkennedy Dec 6 '19 at 1:19

Browse other questions tagged or ask your own question.