Description Usage Arguments Value Note See Also Examples
Project Linework is "A library of handcrafted vector linework for cartography, each designed in a unique aesthetic style. They are meant to break us away from default line paths that we so often rely on by providing more visually-interesting alternatives."
1 2 | linework_map(linework_set = "elmer_casual", admin_level = 1,
fortified = FALSE)
|
linework_set |
one of |
admin_level |
either |
fortified |
|
SpatialPolygonsDataFrame
or regular data.frame
Unfortunately, there was no regulation within Project Linework to
standardize on the format for the shapefile data columns, so you'll
have to inspect the @data
element of the non-fortified
returned object or the str
of the fortified returned object
to get an idea for fields that you can subset on. You can perform
this inspection with a call to lineworks
.
Project Linework for more information about the shapefiles
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | library(sp)
# plot admin1 polygons for Elmer Casual (the defaults)
plot(linework_map())
# plot the continental United States "Wargames" style
library(ggplot2)
library(ggthemes)
wargames <- linework_map("wargames", fortified=TRUE)
us <- wargames[wargames$iso_a2=="US" & !wargames$code_hasc %in% c("US.HI", "US.AK"),]
ggplot(us) +
geom_map(map=us, aes(x=long, y=lat, map_id=id)) +
coord_map(project="albers", lat0=37.5, lat1=29.5) +
theme_map()
# fancier example
elmer <- linework_map("elmer_casual", fortified=TRUE)
us <- elmer[elmer$COUNTRY=="US" & elmer$Name != "Alaska",]
gg <- ggplot()
gg <- gg + geom_map(data=us, map=us,
aes(x=long, y=lat, map_id=id),
color="#939598", fill="#d1d2d4", size=0.5)
gg <- gg + coord_map(project="albers", lat0=37.5, lat1=29.5)
gg <- gg + labs(title="Elmer Casual")
gg <- gg + theme_map()
gg <- gg + theme(plot.title=element_text(size=16))
gg
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.