Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
boB Rudis 07aa87f6b5
edge case
4 лет назад
R edge case 4 лет назад
README_files/figure-gfm 0.4.0 4 лет назад
inst/extdata argh 4 лет назад
man points_elided_sf() 4 лет назад
tests restored missing rds files 7 лет назад
.Rbuildignore 0.4.0 4 лет назад
.gitignore closes #17 5 лет назад
.travis.yml restored missing rds files 7 лет назад
CONDUCT.md Update README 6 лет назад
DESCRIPTION points_elided_sf() 4 лет назад
LICENSE 0.4.0 4 лет назад
LICENSE.md 0.4.0 4 лет назад
NAMESPACE points_elided_sf() 4 лет назад
NEWS.md 0.4.0 4 лет назад
README.Rmd 0.4.0 4 лет назад
README.md 0.4.0 4 лет назад
albersusa.Rproj restored missing rds files 7 лет назад

README.md

Project Status: Active – The project has reached a stable, usablestate and is being activelydeveloped. Signedby Signed commit% Linux buildStatus CoverageStatus Minimal RVersion License

albersusa

Tools, Shapefiles & Data to Work with an ‘AlbersUSA’ Composite Projection

Description

Creating a composite projection for states and counties of the United States that includes scaled and shifted polygons for Alaska and Hawaii is time consuming and potentially error-prone. Functions and data sets are provided to make it easier to produce maps with a composite projection. Furthermore, named projections for common transormations are provided to further increase mapping productivity.

What’s Inside The Tin

The following functions are implemented:

  • counties_sf: Retrieve a U.S. county composite map, optionally with a projection, as a simplefeature
  • usa_sf: Retreive a U.S. state composite map, optionally with a projection, as a simplefeature

New 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 projection
  • counties_composite: Retrieve a U.S. county composite map, optionally with a projection

Pre-canned projection strings:

  • us_aeqd_proj: Oblique azimuthal equidistant convenience projection
  • us_eqdc_proj: Equidistant conic convenience projection
  • us_laea_proj: Albers equal-area conic convenience projection
  • us_lcc_proj: Lambert conformal conic convenience projection
  • us_longlat_proj: Generic long/lat convenience projection

The 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).

Installation

remotes::install_git("https://git.rud.is/hrbrmstr/albersusa.git")
# or
remotes::install_git("https://git.sr.ht/~hrbrmstr/albersusa")
# or
remotes::install_gitlab("hrbrmstr/albersusa")
# or
remotes::install_bitbucket("hrbrmstr/albersusa")
# or
remotes::install_github("hrbrmstr/albersusa")

NOTE: To use the ‘remotes’ install options you will need to have the {remotes} package installed.

Usage

library(albersusa)
library(sf)
library(sp)
library(rgeos)
library(maptools)
library(ggplot2)
library(ggalt)
library(ggthemes)
library(viridis)
library(scales)

# current version
packageVersion("albersusa")
## [1] '0.4.0'

Simple features base

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"])

ggplot2

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)

albersusa Metrics

Lang # Files (%) LoC (%) Blank lines (%) # Lines (%)
R 9 0.9 106 0.77 66 0.67 277 0.86
Rmd 1 0.1 31 0.23 32 0.33 46 0.14

Code of Conduct

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.