Download and read shapefile function in R
问题 I would like to expand on this function. As of now, the function downloads and unzips the shape file from the web. I would like to implement 'rgdal' to read the file into R. library(rgdal) dlshape=function(location) { temp=tempfile() download.file(location, temp) unzip(temp) } I found the following code on SO, but I was unsuccessful in adapting it. It appears that the function still looks at the first file unzipped rather than grep for a file ending with the .shp extension. read.csv.zip <-