erdavis1 / RoadColors

Plot US roads, coloring each by its designation (e.g. Street, Road, Avenue)
161 stars 38 forks source link

Error with read_sf(".",filename) #1

Closed alxgal closed 4 years ago

alxgal commented 4 years ago

Hi, I tried following your code but am getting the following issue when i try to read_sf(".",filename):

Error in mapply(FUN = f, ..., SIMPLIFY = FALSE) : 
  zero-length inputs cannot be mixed with those of non-zero length

I have the following filed downloaded in the wd:

gis_osm_roads_free_1.cpg
gis_osm_roads_free_1.dbf
gis_osm_roads_free_1.prj
gis_osm_roads_free_1.shp
gis_osm_roads_free_1.shx

Obviously, filname is set to "gis_osm_roads_free_1" Any idea why I'm getting that error? Thanks in advance!

erdavis1 commented 4 years ago

Hey--I'm actually not sure what could cause that. Do you get the same error if you try a different working directory, or if you download a different set of shapefiles?

alxgal commented 4 years ago

I think I figured out the issue here: the sf package was updated and built under R 3.5.2, while I was running 3.5.1 still. I realized that because the package stopped loading (which for some reason it did when I first tried it). I updated R, reinstalled sf and can now use the read_sf function above correctly without error warnings :) Thanks for your reply anyways!