Browse Source

Merge branch 'master' into master

master
boB Rudis 7 years ago
committed by GitHub
parent
commit
297863dac8
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. BIN
      .DS_Store
  2. 12
      DESCRIPTION
  3. 3
      NAMESPACE
  4. 3
      NEWS.md
  5. 6
      R/albersusa-package.R
  6. 2
      R/counties.r
  7. 62
      R/counties_sf.r
  8. 67
      R/states_sf.r
  9. 31
      README.Rmd
  10. 94
      README.md
  11. BIN
      README_files/figure-markdown_github/unnamed-chunk-4-1.png
  12. BIN
      README_files/figure-markdown_github/unnamed-chunk-4-2.png
  13. BIN
      README_files/figure-markdown_github/unnamed-chunk-5-1.png
  14. BIN
      README_files/figure-markdown_github/unnamed-chunk-5-10.png
  15. BIN
      README_files/figure-markdown_github/unnamed-chunk-5-11.png
  16. BIN
      README_files/figure-markdown_github/unnamed-chunk-5-12.png
  17. BIN
      README_files/figure-markdown_github/unnamed-chunk-5-13.png
  18. BIN
      README_files/figure-markdown_github/unnamed-chunk-5-14.png
  19. BIN
      README_files/figure-markdown_github/unnamed-chunk-5-15.png
  20. BIN
      README_files/figure-markdown_github/unnamed-chunk-5-16.png
  21. BIN
      README_files/figure-markdown_github/unnamed-chunk-5-17.png
  22. BIN
      README_files/figure-markdown_github/unnamed-chunk-5-18.png
  23. BIN
      README_files/figure-markdown_github/unnamed-chunk-5-19.png
  24. BIN
      README_files/figure-markdown_github/unnamed-chunk-5-2.png
  25. BIN
      README_files/figure-markdown_github/unnamed-chunk-5-3.png
  26. BIN
      README_files/figure-markdown_github/unnamed-chunk-5-4.png
  27. BIN
      README_files/figure-markdown_github/unnamed-chunk-5-5.png
  28. BIN
      README_files/figure-markdown_github/unnamed-chunk-5-6.png
  29. BIN
      README_files/figure-markdown_github/unnamed-chunk-5-7.png
  30. BIN
      README_files/figure-markdown_github/unnamed-chunk-5-8.png
  31. BIN
      README_files/figure-markdown_github/unnamed-chunk-5-9.png
  32. BIN
      inst/.DS_Store
  33. BIN
      inst/extdata/.DS_Store
  34. BIN
      inst/extdata/counties_sf.rda
  35. BIN
      inst/extdata/states_sf.rda
  36. 5
      man/albersusa.Rd
  37. 47
      man/counties_sf.Rd
  38. 52
      man/usa_sf.Rd

BIN
.DS_Store

Binary file not shown.

12
DESCRIPTION

@ -1,10 +1,10 @@
Package: albersusa
Type: Package
Title: Tools, Shapefiles & Data to Work with an 'AlbersUSA' Composite Projection
Version: 0.2.0
Date: 2016-03-29
Author: Bob Rudis (@hrbrmstr)
Maintainer: Bob Rudis <bob@rudis.net>
Version: 0.3.0
Date: 2017-01-26
Author: Bob Rudis (bob@rud.is)
Maintainer: Bob Rudis <bob@rud.is>
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
@ -15,11 +15,13 @@ BugReports: https://github.com/hrbrmstr/albersusa/issues
License: AGPL
Suggests:
testthat,
ggalt
ggalt,
tibble
Depends:
R (>= 3.0.0)
Imports:
sp,
sf,
rgeos,
rgdal,
maptools

3
NAMESPACE

@ -2,13 +2,16 @@
export(counties_composite)
export(points_elided)
export(counties_sf)
export(us_aeqd_proj)
export(us_eqdc_proj)
export(us_laea_proj)
export(us_lcc_proj)
export(us_longlat_proj)
export(usa_composite)
export(usa_sf)
import(maptools)
import(rgdal)
import(rgeos)
import(sf)
import(sp)

3
NEWS.md

@ -1,2 +1,5 @@
0.3.0
* simplefeatures (sf) functions
0.1.0
* Initial release

6
R/albersusa-package.R

@ -6,6 +6,9 @@
#' produce maps with a composite projection. Furthermore, named projections for common
#' transormations are provided to further increase mapping productivity.
#'
#' Newer \code{sf} (simple features) objects can be returned or legacy R
#' spatial \code{sp} objects can be returned.
#'
#' Reference GeoJSON files are provided in the following locations (i.e. you can use
#' them in any mapping program):
#'
@ -16,6 +19,7 @@
#'
#' @name albersusa
#' @docType package
#' @author Bob Rudis (@@hrbrmstr)
#' @author Bob Rudis (bob@@rud.is)
#' @import sp rgeos rgdal maptools
#' @import sf
NULL

2
R/counties.r

@ -60,4 +60,4 @@ counties_composite <- function(proj=c("longlat", "laea", "lcc", "eqdc", "aeqd"))
cty
}
}

62
R/counties_sf.r

@ -0,0 +1,62 @@
#' Retreive a U.S. county composite map, optionally with a projection, as a simplefeature
#'
#' The \code{proj} parameter is intende to simplify usage for those using base
#' plotting. If anything but \code{longlat} is specified the composite map
#' will be pre-projected to those
#'
#' This is what's in the object looks like:
#'
#' \preformatted{
#' Observations: 3,143
#' Variables: 9
#' $ fips <fctr> 01001, 01009, 01017, 01021, 01033, 01045, 01051, 01065, 01079, 0...
#' $ state_fips <fctr> 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 05, 05, 06, ...
#' $ county_fips <fctr> 001, 009, 017, 021, 033, 045, 051, 065, 079, 083, 099, 107, 121,...
#' $ name <fctr> Autauga, Blount, Chambers, Chilton, Colbert, Dale, Elmore, Hale,...
#' $ lsad <fctr> County, County, County, County, County, County, County, County, ...
#' $ census_area <dbl> 594.436, 644.776, 596.531, 692.854, 592.619, 561.150, 618.485, 64...
#' $ state <fctr> Alabama, Alabama, Alabama, Alabama, Alabama, Alabama, Alabama, A...
#' $ iso_3166_2 <fctr> AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AR, AR, CA, ...
#' $ geometry <simple_feature> MULTIPOLYGON(((-86.496774 3..., MULTIPOLYGON(((-86.577...#' }
#'
#' A reference GeoJSON file isprovided in the following location (i.e. you can use
#' it in any mapping program):
#'
#' \preformatted{
#' system.file("extdata/composite_us_counties.geojson.gz", package="albersusa")
#' }
#'
#' @param proj if anything but \code{longlat} is specified, the shapefile will
#' be pre-projected before being returned
#' @export
#' @examples
#' library(sf)
#'
#' plot(counties_sf()) # these take a while to render
#' plot(counties_sf("laea"))
counties_sf <- function(proj=c("longlat", "laea", "lcc", "eqdc", "aeqd")) {
# us <- readOGR(system.file("extdata/composite_us_counties.geojson", package="albersusa"),
# "OGRGeoJSON",
# stringsAsFactors=FALSE,
# verbose=FALSE)
cty <- readRDS(system.file("extdata/counties_sf.rda", package="albersusa"))
proj <- match.arg(proj, c("longlat", "laea", "lcc", "eqdc", "aeqd"))
if (proj != "longlat") {
proj <- switch(proj,
laea=us_laea_proj,
lcc=us_lcc_proj,
eqdc=us_eqdc_proj,
aeqd=us_aeqd_proj)
cty <- sf::st_transform(cty, proj)
}
cty
}

67
R/states_sf.r

@ -0,0 +1,67 @@
#' Retreive a U.S. state composite map, optionally with a projection, as a simplefeature
#'
#' The \code{proj} parameter is intende to simplify usage for those using base
#' plotting. If anything but \code{longlat} is specified the composite map
#' will be pre-projected to those
#'
#' This is what's the object looks like:
#'
#' \preformatted{
#' Observations: 51
#' Variables: 14
#' $ geo_id <fctr> 0400000US04, 0400000US05, 0400000US06, 0400000US08, 0400...
#' $ fips_state <fctr> 04, 05, 06, 08, 09, 11, 13, 17, 18, 22, 27, 28, 30, 35, ...
#' $ name <fctr> Arizona, Arkansas, California, Colorado, Connecticut, Di...
#' $ lsad <fctr> , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
#' $ census_area <dbl> 113594.084, 52035.477, 155779.220, 103641.888, 4842.355, ...
#' $ iso_3166_2 <fctr> AZ, AR, CA, CO, CT, DC, GA, IL, IN, LA, MN, MS, MT, NM, ...
#' $ census <int> 6392017, 2915918, 37253956, 5029196, 3574097, 601723, 968...
#' $ pop_estimataes_base <int> 6392310, 2915958, 37254503, 5029324, 3574096, 601767, 968...
#' $ pop_2010 <int> 6411999, 2922297, 37336011, 5048575, 3579345, 605210, 971...
#' $ pop_2011 <int> 6472867, 2938430, 37701901, 5119661, 3590537, 620427, 981...
#' $ pop_2012 <int> 6556236, 2949300, 38062780, 5191709, 3594362, 635040, 991...
#' $ pop_2013 <int> 6634997, 2958765, 38431393, 5272086, 3599341, 649111, 999...
#' $ pop_2014 <int> 6731484, 2966369, 38802500, 5355866, 3596677, 658893, 100...
#' $ geometry <list> [-112.53859, -112.53454, -112.36895, -112.35769, -111.41...#' }
#'
#' A reference GeoJSON file is provided in the following location (i.e. you can use
#' it in any mapping program):
#'
#' \preformatted{
#' system.file("extdata/composite_us_states.geojson.gz", package="albersusa")
#' }
#'
#' @param proj if anything but \code{longlat} is specified, the shapefile will
#' be pre-projected before being returned
#' @export
#' @examples
#' library(sf)
#'
#' plot(usa_sf()) # these take a while to render
#' plot(usa_sf("laea"))
usa_sf <- function(proj=c("longlat", "laea", "lcc", "eqdc", "aeqd")) {
# us <- readOGR(system.file("extdata/composite_us_states.geojson", package="albersusa"),
# "OGRGeoJSON",
# stringsAsFactors=FALSE,
# verbose=FALSE)
us <- readRDS(system.file("extdata/states_sf.rda", package="albersusa"))
proj <- match.arg(proj, c("longlat", "laea", "lcc", "eqdc", "aeqd"))
if (proj != "longlat") {
proj <- switch(proj,
laea=us_laea_proj,
lcc=us_lcc_proj,
eqdc=us_eqdc_proj,
aeqd=us_aeqd_proj)
us <- sf::st_transform(us, proj)
}
us
}

31
README.Rmd

@ -7,21 +7,28 @@ output: rmarkdown::github_document
The following functions are implemented:
- `counties_sf`: Retreive 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
Some legacy ones:
- `usa_composite`: Retreive a U.S. composite map, optionally with a projection
- `counties_composite`: Retreive 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
- `counties_composite`: Retreive a U.S. county composite map, optionally with a 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 `@data` slot of each `SpatialPolygonsDataFrame` has some handy data you can
use (like FIPS codes and state/county population information).
Also, the simplefeatures coluns and `@data` slot of each `SpatialPolygonsDataFrame` has some handy data you can use (like FIPS codes and state/county population information).
### Installation
@ -37,6 +44,7 @@ options(width=120)
```{r message=FALSE, fig.retina=2}
library(albersusa)
library(sf)
library(sp)
library(rgeos)
library(maptools)
@ -48,7 +56,23 @@ library(scales)
# current verison
packageVersion("albersusa")
```
### Simple features
```{r message=FALSE, fig.retina=2}
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"])
```
### Legacy
```{r message=FALSE, warning=FALSE, fig.retina=2}
us <- usa_composite()
dplyr::glimpse(us@data)
@ -134,4 +158,3 @@ date()
test_dir("tests/")
```

94
README.md

@ -5,20 +5,28 @@
The following functions are implemented:
- `counties_sf`: Retreive 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
Some legacy ones:
- `usa_composite`: Retreive a U.S. composite map, optionally with a projection
- `counties_composite`: Retreive 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
- `counties_composite`: Retreive a U.S. county composite map, optionally with a 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 `@data` slot of each `SpatialPolygonsDataFrame` has some handy data you can use (like FIPS codes and state/county population information).
Also, the simplefeatures coluns and `@data` slot of each `SpatialPolygonsDataFrame` has some handy data you can use (like FIPS codes and state/county population information).
### Installation
@ -30,6 +38,7 @@ devtools::install_github("hrbrmstr/albersusa")
``` r
library(albersusa)
library(sf)
library(sp)
library(rgeos)
library(maptools)
@ -43,7 +52,27 @@ library(scales)
packageVersion("albersusa")
```
## [1] '0.2.0'
## [1] '0.3.0'
### Simple features
``` r
par(mar=c(0,0,1,0))
us_sf <- usa_sf("laea")
plot(us_sf["pop_2012"])
```
<img src="README_files/figure-markdown_github/unnamed-chunk-4-1.png" width="672" />
``` r
cty_sf <- counties_sf("aeqd")
plot(cty_sf["census_area"])
```
<img src="README_files/figure-markdown_github/unnamed-chunk-4-2.png" width="672" />
### Legacy
``` r
us <- usa_composite()
@ -71,14 +100,14 @@ dplyr::glimpse(us@data)
plot(us, lwd=0.25)
```
<img src="README_files/figure-markdown_github/unnamed-chunk-3-1.png" width="672" />
<img src="README_files/figure-markdown_github/unnamed-chunk-5-1.png" width="672" />
``` r
us <- usa_composite("laea")
plot(us, lwd=0.25)
```
<img src="README_files/figure-markdown_github/unnamed-chunk-3-2.png" width="672" />
<img src="README_files/figure-markdown_github/unnamed-chunk-5-2.png" width="672" />
``` r
us <- usa_composite()
@ -88,57 +117,48 @@ gg <- ggplot()
gg <- gg + geom_map(data=us_map, map=us_map,
aes(x=long, y=lat, map_id=id),
color="#2b2b2b", size=0.1, fill=NA)
```
## Warning: Ignoring unknown aesthetics: x, y
``` r
gg <- gg + theme_map()
```
## Warning: `panel.margin` is deprecated. Please use `panel.spacing` property instead
``` r
gg + coord_map()
```
<img src="README_files/figure-markdown_github/unnamed-chunk-3-3.png" width="672" />
<img src="README_files/figure-markdown_github/unnamed-chunk-5-3.png" width="672" />
``` r
gg + coord_map("polyconic")
```
<img src="README_files/figure-markdown_github/unnamed-chunk-3-4.png" width="672" />
<img src="README_files/figure-markdown_github/unnamed-chunk-5-4.png" width="672" />
``` r
gg + coord_proj()
```
<img src="README_files/figure-markdown_github/unnamed-chunk-3-5.png" width="672" />
<img src="README_files/figure-markdown_github/unnamed-chunk-5-5.png" width="672" />
``` r
gg + coord_proj(us_laea_proj)
```
<img src="README_files/figure-markdown_github/unnamed-chunk-3-6.png" width="672" />
<img src="README_files/figure-markdown_github/unnamed-chunk-5-6.png" width="672" />
``` r
gg + coord_proj(us_aeqd_proj)
```
<img src="README_files/figure-markdown_github/unnamed-chunk-3-7.png" width="672" />
<img src="README_files/figure-markdown_github/unnamed-chunk-5-7.png" width="672" />
``` r
gg + coord_proj(us_eqdc_proj)
```
<img src="README_files/figure-markdown_github/unnamed-chunk-3-8.png" width="672" />
<img src="README_files/figure-markdown_github/unnamed-chunk-5-8.png" width="672" />
``` r
gg + coord_proj(us_lcc_proj)
```
<img src="README_files/figure-markdown_github/unnamed-chunk-3-9.png" width="672" />
<img src="README_files/figure-markdown_github/unnamed-chunk-5-9.png" width="672" />
``` r
gg +
@ -151,7 +171,7 @@ gg +
legend.key.width=unit(3, "lines"))
```
<img src="README_files/figure-markdown_github/unnamed-chunk-3-10.png" width="672" />
<img src="README_files/figure-markdown_github/unnamed-chunk-5-10.png" width="672" />
``` r
us <- counties_composite()
@ -174,14 +194,14 @@ dplyr::glimpse(us@data)
plot(us, lwd=0.25)
```
<img src="README_files/figure-markdown_github/unnamed-chunk-3-11.png" width="672" />
<img src="README_files/figure-markdown_github/unnamed-chunk-5-11.png" width="672" />
``` r
us <- counties_composite("laea")
plot(us, lwd=0.25)
```
<img src="README_files/figure-markdown_github/unnamed-chunk-3-12.png" width="672" />
<img src="README_files/figure-markdown_github/unnamed-chunk-5-12.png" width="672" />
``` r
us <- counties_composite()
@ -191,57 +211,48 @@ gg <- ggplot()
gg <- gg + geom_map(data=us_map, map=us_map,
aes(x=long, y=lat, map_id=id),
color="#2b2b2b", size=0.1, fill=NA)
```
## Warning: Ignoring unknown aesthetics: x, y
``` r
gg <- gg + theme_map()
```
## Warning: `panel.margin` is deprecated. Please use `panel.spacing` property instead
``` r
gg + coord_map()
```
<img src="README_files/figure-markdown_github/unnamed-chunk-3-13.png" width="672" />
<img src="README_files/figure-markdown_github/unnamed-chunk-5-13.png" width="672" />
``` r
gg + coord_map("polyconic")
```
<img src="README_files/figure-markdown_github/unnamed-chunk-3-14.png" width="672" />
<img src="README_files/figure-markdown_github/unnamed-chunk-5-14.png" width="672" />
``` r
gg + coord_proj()
```
<img src="README_files/figure-markdown_github/unnamed-chunk-3-15.png" width="672" />
<img src="README_files/figure-markdown_github/unnamed-chunk-5-15.png" width="672" />
``` r
gg + coord_proj(us_laea_proj)
```
<img src="README_files/figure-markdown_github/unnamed-chunk-3-16.png" width="672" />
<img src="README_files/figure-markdown_github/unnamed-chunk-5-16.png" width="672" />
``` r
gg + coord_proj(us_aeqd_proj)
```
<img src="README_files/figure-markdown_github/unnamed-chunk-3-17.png" width="672" />
<img src="README_files/figure-markdown_github/unnamed-chunk-5-17.png" width="672" />
``` r
gg + coord_proj(us_eqdc_proj)
```
<img src="README_files/figure-markdown_github/unnamed-chunk-3-18.png" width="672" />
<img src="README_files/figure-markdown_github/unnamed-chunk-5-18.png" width="672" />
``` r
gg + coord_proj(us_lcc_proj)
```
<img src="README_files/figure-markdown_github/unnamed-chunk-3-19.png" width="672" />
<img src="README_files/figure-markdown_github/unnamed-chunk-5-19.png" width="672" />
### Test Results
@ -252,7 +263,7 @@ library(testthat)
date()
```
## [1] "Mon Dec 19 16:02:00 2016"
## [1] "Thu Jan 26 23:49:15 2017"
``` r
test_dir("tests/")
@ -262,4 +273,3 @@ test_dir("tests/")
## OK: 6 SKIPPED: 0 FAILED: 0
##
## DONE ===================================================================================================================
## You rock!

BIN
README_files/figure-markdown_github/unnamed-chunk-4-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 KiB

BIN
README_files/figure-markdown_github/unnamed-chunk-4-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 538 KiB

BIN
README_files/figure-markdown_github/unnamed-chunk-5-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

BIN
README_files/figure-markdown_github/unnamed-chunk-5-10.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

BIN
README_files/figure-markdown_github/unnamed-chunk-5-11.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 KiB

BIN
README_files/figure-markdown_github/unnamed-chunk-5-12.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 KiB

BIN
README_files/figure-markdown_github/unnamed-chunk-5-13.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 KiB

BIN
README_files/figure-markdown_github/unnamed-chunk-5-14.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 KiB

BIN
README_files/figure-markdown_github/unnamed-chunk-5-15.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 KiB

BIN
README_files/figure-markdown_github/unnamed-chunk-5-16.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 KiB

BIN
README_files/figure-markdown_github/unnamed-chunk-5-17.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 KiB

BIN
README_files/figure-markdown_github/unnamed-chunk-5-18.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 KiB

BIN
README_files/figure-markdown_github/unnamed-chunk-5-19.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 KiB

BIN
README_files/figure-markdown_github/unnamed-chunk-5-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

BIN
README_files/figure-markdown_github/unnamed-chunk-5-3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

BIN
README_files/figure-markdown_github/unnamed-chunk-5-4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

BIN
README_files/figure-markdown_github/unnamed-chunk-5-5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

BIN
README_files/figure-markdown_github/unnamed-chunk-5-6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

BIN
README_files/figure-markdown_github/unnamed-chunk-5-7.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

BIN
README_files/figure-markdown_github/unnamed-chunk-5-8.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

BIN
README_files/figure-markdown_github/unnamed-chunk-5-9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

BIN
inst/.DS_Store

Binary file not shown.

BIN
inst/extdata/.DS_Store

Binary file not shown.

BIN
inst/extdata/counties_sf.rda

Binary file not shown.

BIN
inst/extdata/states_sf.rda

Binary file not shown.

5
man/albersusa.Rd

@ -13,6 +13,9 @@ produce maps with a composite projection. Furthermore, named projections for com
transormations are provided to further increase mapping productivity.
}
\details{
Newer \code{sf} (simple features) objects can be returned or legacy R
spatial \code{sp} objects can be returned.
Reference GeoJSON files are provided in the following locations (i.e. you can use
them in any mapping program):
@ -22,6 +25,6 @@ system.file("extdata/composite_us_counties.geojson.gz", package="albersusa")
}
}
\author{
Bob Rudis (@hrbrmstr)
Bob Rudis (bob@rud.is)
}

47
man/counties_sf.Rd

@ -0,0 +1,47 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/counties_sf.r
\name{counties_sf}
\alias{counties_sf}
\title{Retreive a U.S. county composite map, optionally with a projection, as a simplefeature}
\usage{
counties_sf(proj = c("longlat", "laea", "lcc", "eqdc", "aeqd"))
}
\arguments{
\item{proj}{if anything but \code{longlat} is specified, the shapefile will
be pre-projected before being returned}
}
\description{
The \code{proj} parameter is intende to simplify usage for those using base
plotting. If anything but \code{longlat} is specified the composite map
will be pre-projected to those
}
\details{
This is what's in the object looks like:
\preformatted{
Observations: 3,143
Variables: 9
$ fips <fctr> 01001, 01009, 01017, 01021, 01033, 01045, 01051, 01065, 01079, 0...
$ state_fips <fctr> 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 05, 05, 06, ...
$ county_fips <fctr> 001, 009, 017, 021, 033, 045, 051, 065, 079, 083, 099, 107, 121,...
$ name <fctr> Autauga, Blount, Chambers, Chilton, Colbert, Dale, Elmore, Hale,...
$ lsad <fctr> County, County, County, County, County, County, County, County, ...
$ census_area <dbl> 594.436, 644.776, 596.531, 692.854, 592.619, 561.150, 618.485, 64...
$ state <fctr> Alabama, Alabama, Alabama, Alabama, Alabama, Alabama, Alabama, A...
$ iso_3166_2 <fctr> AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AR, AR, CA, ...
$ geometry <simple_feature> MULTIPOLYGON(((-86.496774 3..., MULTIPOLYGON(((-86.577...#' }
A reference GeoJSON file isprovided in the following location (i.e. you can use
it in any mapping program):
\preformatted{
system.file("extdata/composite_us_counties.geojson.gz", package="albersusa")
}
}
\examples{
library(sf)
plot(counties_sf()) # these take a while to render
plot(counties_sf("laea"))
}

52
man/usa_sf.Rd

@ -0,0 +1,52 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/states_sf.r
\name{usa_sf}
\alias{usa_sf}
\title{Retreive a U.S. state composite map, optionally with a projection, as a simplefeature}
\usage{
usa_sf(proj = c("longlat", "laea", "lcc", "eqdc", "aeqd"))
}
\arguments{
\item{proj}{if anything but \code{longlat} is specified, the shapefile will
be pre-projected before being returned}
}
\description{
The \code{proj} parameter is intende to simplify usage for those using base
plotting. If anything but \code{longlat} is specified the composite map
will be pre-projected to those
}
\details{
This is what's the object looks like:
\preformatted{
Observations: 51
Variables: 14
$ geo_id <fctr> 0400000US04, 0400000US05, 0400000US06, 0400000US08, 0400...
$ fips_state <fctr> 04, 05, 06, 08, 09, 11, 13, 17, 18, 22, 27, 28, 30, 35, ...
$ name <fctr> Arizona, Arkansas, California, Colorado, Connecticut, Di...
$ lsad <fctr> , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
$ census_area <dbl> 113594.084, 52035.477, 155779.220, 103641.888, 4842.355, ...
$ iso_3166_2 <fctr> AZ, AR, CA, CO, CT, DC, GA, IL, IN, LA, MN, MS, MT, NM, ...
$ census <int> 6392017, 2915918, 37253956, 5029196, 3574097, 601723, 968...
$ pop_estimataes_base <int> 6392310, 2915958, 37254503, 5029324, 3574096, 601767, 968...
$ pop_2010 <int> 6411999, 2922297, 37336011, 5048575, 3579345, 605210, 971...
$ pop_2011 <int> 6472867, 2938430, 37701901, 5119661, 3590537, 620427, 981...
$ pop_2012 <int> 6556236, 2949300, 38062780, 5191709, 3594362, 635040, 991...
$ pop_2013 <int> 6634997, 2958765, 38431393, 5272086, 3599341, 649111, 999...
$ pop_2014 <int> 6731484, 2966369, 38802500, 5355866, 3596677, 658893, 100...
$ geometry <list> [-112.53859, -112.53454, -112.36895, -112.35769, -111.41...#' }
A reference GeoJSON file is provided in the following location (i.e. you can use
it in any mapping program):
\preformatted{
system.file("extdata/composite_us_states.geojson.gz", package="albersusa")
}
}
\examples{
library(sf)
plot(usa_sf())
plot(usa_sf("laea"))
}
Loading…
Cancel
Save