I am trying to unzip a shapefile zip file. After download it to my directory, I am getting this error and file is NOT unziped:
Warning message:
In unzip(zipfile = temp, exdir = temp2) : error 1 in extracting from zip file
R code:
dir <- getwd()
dir
zip.combine <- as.character(paste(dir, zip.file, sep = "/"))
zip.combine
download.file("https://github.com/silpai/DC_HarvardX/blob/master/shp/lpr_000a16a_e.zip" , destfile=zip.combine) # Download the shapefile.
zipF<-file.choose() # lets you choose file "lpr_000a16a_e.zip"
outDir<- getwd()
outDir
unzip(zipF,exdir=outDir) # unzip your file
Why I am getting this error 1 in extracting from zip file?
read shapefile
can <- st_read("lpr_000b16a_e.shp")
can