Home > front end >  How to solve problem with reading a shapefile in R
How to solve problem with reading a shapefile in R

Time:06-06

How do I show a map that is in shapefile format that is in a zip file. The file is this:

enter image description here

CodePudding user response:

Try this

library(rgdal)

temp <- tempfile()
temp2 <- tempfile()
download.file("https://geoftp.ibge.gov.br/organizacao_do_territorio/malhas_territoriais/malhas_municipais/municipio_2015/UFs/PR/pr_municipios.zip",temp)

unzip(zipfile = temp, exdir = temp2)
shp <- readOGR(temp2)

plot(shp)

enter image description here

  • Related