Home > Enterprise >  How to draw a state map using R
How to draw a state map using R

Time:01-31

I need help on how to use R to draw a map. I have created an excel csv file with latitude and longitude of counties at the boundaries of the state I want to draw. However, I don’t know the right codes in R to use and get the map drawn. #R #Maps #howtodrawmapsinR #ggplot2 #Rmapcodes

CodePudding user response:

As simple as:

library(maps)
map('county', 'iowa', fill = TRUE, col = palette())

If you like to use the data from your .csv file, then please have a look on sf and sp libraries and get familiar with creating simple geometries, like SpatialPolygons.

  •  Tags:  
  • Related