hrbrpkghelpr::global_opts()
hrbrpkghelpr::stinking_badges()
hrbrpkghelpr::yank_title_and_description()
The following functions are implemented:
counties_sf
: Retrieve a U.S. county composite map, optionally with a projection, as a simplefeatureusa_sf
: Retreive a U.S. state composite map, optionally with a projection, as a simplefeatureNew ones:
points_elided
: Shift points around Alaska and Hawaii to the elided area (by @rdinter)Some legacy ones:
usa_composite
: Retrieve a U.S. composite map, optionally with a projectioncounties_composite
: Retrieve a U.S. county composite map, optionally with a projectionPre-canned projection strings:
us_aeqd_proj
: Oblique azimuthal equidistant convenience projectionus_eqdc_proj
: Equidistant conic convenience projectionus_laea_proj
: Albers equal-area conic convenience projectionus_lcc_proj
: Lambert conformal conic convenience projectionus_longlat_proj
: Generic long/lat convenience projectionThe following data sets are included:
system.file("extdata/composite_us_states.geojson.gz", package="albersusa")
system.file("extdata/composite_us_counties.geojson.gz", package="albersusa")
Also, the simplefeatures columns and @data
slot of each SpatialPolygonsDataFrame
has some handy data you can use (like FIPS codes and state/county population information).
hrbrpkghelpr::install_block()
library(albersusa) library(sf) library(sp) library(rgeos) library(maptools) library(ggplot2) library(ggalt) library(ggthemes) library(viridis) library(scales) # current version packageVersion("albersusa")
par(mar=c(0,0,1,0)) us_sf <- usa_sf("laea") plot(us_sf["pop_2012"]) cty_sf <- counties_sf("aeqd") plot(cty_sf["census_area"])
ggplot() + geom_sf(data = us_sf, size = 0.125) ggplot() + geom_sf(data = us_sf, size = 0.125) + coord_sf(crs = us_longlat_proj) ggplot() + geom_sf(data = cty_sf, size = 0.0725) ggplot() + geom_sf(data = cty_sf, size = 0.0725) + coord_sf(crs = us_longlat_proj)
cloc::cloc_pkg_md()
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.