maps
packageThe maps package is the best source of geospatial data in R.
The whole list of offered data is available typing:
help(package='maps')
.
It includes:
world
, world.cities
,
lakes
county
, state
,
usa
france
italy
nz
The code below shows how to use one of this geospatial object.
# Load library
library(maps)
# Check all available geospatial objects:
# help(package='maps')
# Map of the world:
map('world',col="grey", fill=TRUE, bg="white", lwd=0.05, mar=rep(0,4),border=0, ylim=c(-80,80) )
mapdata
package
The
mapdata
package extends the maps
package with more geospatial
datasets:
china
japan
world2Hires
)
See complete list with help(package='mapdata')
# Load library
library(mapdata)
# Check all available geospatial objects:
# help(package='mapdata')
# Map of Japan:
map('japan',col="black", lwd=1, mar=rep(0,4) )
oz
packageThe oz package provides several geospatial object concerning Australia.
Plot the general country using the oz()
function, or
states using nsw()
, qld()
and so on..
Type help(package='oz')
for documentation.
👋 After crafting hundreds of R charts over 12 years, I've distilled my top 10 tips and tricks. Receive them via email! One insight per day for the next 10 days! 🔥