Question about choropleth map's shape file

Hi, I've been trying to put shapefile in r studio
that's what I do

# Download the shapefile. (note that I store it in a folder called DATA. You have to change that if needed.)
download.file("" , destfile="C:/Users/Administrator/Desktop/")
# You now have it in your current working directory, have a look!

# Unzip this file. You can do it with R (as below), or clicking on the object you downloaded.
#  -- > You now have 4 files. One of these files is a .shp file! (TM_WORLD_BORDERS_SIMPL-0.3.shp)

# Read this shape file with the rgdal library. 
my_spdf <- readOGR( 
  dsn= paste0(getwd(),"C:/Users/Administrator/Downloads/") , 


# -- > Now you have a Spdf object (spatial polygon data frame). You can start doing maps!

Download successfully
Unzip successfully
But when I use readOGR, it only returns: Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv, :
Cannot open data source
When I use file.exist()
it return false.
But I do have a shapefile downloaded on the Desktop. Can anyone fix it?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.