diff --git a/.Rbuildignore b/.Rbuildignore index 1d01b39..15e3261 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,7 +1,8 @@ ^.*\.Rproj$ ^\.Rproj\.user$ ^\.travis\.yml$ -^README\.*md$ +^README\.Rmd$ ^README\.*html$ ^NOTES\.*md$ ^NOTES\.*html$ +^README_files/$ \ No newline at end of file diff --git a/README.Rmd b/README.Rmd index 8ce16a9..3f758ca 100644 --- a/README.Rmd +++ b/README.Rmd @@ -6,12 +6,21 @@ output: variant: markdown_github --- -`albersusa` : ... +`albersusa` : Tools, Shapefiles & Data to Work with an 'AlbersUSA' Composite Projection The following functions are implemented: +- `usa_composite`: Retreive a U.S. composite map, optionally with a projection +- `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", package="albersusa")` - composite GeoJSON + ### Installation ```{r eval=FALSE} @@ -24,12 +33,46 @@ options(width=120) ### Usage -```{r} +```{r message=FALSE, fig.retina=2} library(albersusa) +library(sp) +library(rgeos) +library(maptools) +library(ggplot2) +library(ggalt) +library(ggthemes) # current verison packageVersion("albersusa") +us <- usa_composite() +plot(us) + +us <- usa_composite("laea") +plot(us) + +us <- usa_composite() +us_map <- fortify(us, region="NAME") + +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) +gg <- gg + theme_map() + +gg + coord_map() + +gg + coord_map("polyconic") + +gg + coord_proj() + +gg + coord_proj(us_laea_proj) + +gg + coord_proj(us_aeqd_proj) + +gg + coord_proj(us_eqdc_proj) + +gg + coord_proj(us_lcc_proj) ``` ### Test Results diff --git a/README.html b/README.html new file mode 100644 index 0000000..5ace100 --- /dev/null +++ b/README.html @@ -0,0 +1,212 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +

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

+

The following functions are implemented:

+ +

The following data sets are included:

+ +
+

Installation

+
devtools::install_github("hrbrmstr/albersusa")
+
+
+

Usage

+
library(albersusa)
+library(sp)
+library(rgeos)
+library(maptools)
+library(ggplot2)
+library(ggalt)
+library(ggthemes)
+
+# current verison
+packageVersion("albersusa")
+
## [1] '0.1.0'
+
us <- usa_composite()
+plot(us)
+

+
us <- usa_composite("laea")
+plot(us)
+

+
us <- usa_composite()
+us_map <- fortify(us, region="NAME")
+
+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)
+gg <- gg + theme_map()
+
+gg + coord_map()
+

+
gg + coord_map("polyconic")
+

+
gg + coord_proj()
+

+
gg + coord_proj(us_laea_proj)
+

+
gg + coord_proj(us_aeqd_proj)
+

+
gg + coord_proj(us_eqdc_proj)
+

+
gg + coord_proj(us_lcc_proj)
+

+
+
+

Test Results

+
library(albersusa)
+library(testthat)
+
+date()
+
## [1] "Mon Mar 28 16:25:47 2016"
+
test_dir("tests/")
+
## testthat results ========================================================================================================
+## OK: 0 SKIPPED: 0 FAILED: 0
+
+ + + + +
+ + + + + + + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..b30adba --- /dev/null +++ b/README.md @@ -0,0 +1,133 @@ + +`albersusa` : Tools, Shapefiles & Data to Work with an 'AlbersUSA' Composite Projection + +The following functions are implemented: + +- `usa_composite`: Retreive a U.S. composite map, optionally with a projection +- `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", package="albersusa")` - composite GeoJSON + +### Installation + + +```r +devtools::install_github("hrbrmstr/albersusa") +``` + + + +### Usage + + +```r +library(albersusa) +library(sp) +library(rgeos) +library(maptools) +library(ggplot2) +library(ggalt) +library(ggthemes) + +# current verison +packageVersion("albersusa") +``` + +``` +## [1] '0.1.0' +``` + +```r +us <- usa_composite() +plot(us) +``` + + + +```r +us <- usa_composite("laea") +plot(us) +``` + + + +```r +us <- usa_composite() +us_map <- fortify(us, region="NAME") + +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) +gg <- gg + theme_map() + +gg + coord_map() +``` + + + +```r +gg + coord_map("polyconic") +``` + + + +```r +gg + coord_proj() +``` + + + +```r +gg + coord_proj(us_laea_proj) +``` + + + +```r +gg + coord_proj(us_aeqd_proj) +``` + + + +```r +gg + coord_proj(us_eqdc_proj) +``` + + + +```r +gg + coord_proj(us_lcc_proj) +``` + + + +### Test Results + + +```r +library(albersusa) +library(testthat) + +date() +``` + +``` +## [1] "Mon Mar 28 16:25:47 2016" +``` + +```r +test_dir("tests/") +``` + +``` +## testthat results ======================================================================================================== +## OK: 0 SKIPPED: 0 FAILED: 0 +``` + diff --git a/README_files/figure-html/unnamed-chunk-3-1.png b/README_files/figure-html/unnamed-chunk-3-1.png new file mode 100644 index 0000000..1237e8f Binary files /dev/null and b/README_files/figure-html/unnamed-chunk-3-1.png differ diff --git a/README_files/figure-html/unnamed-chunk-3-2.png b/README_files/figure-html/unnamed-chunk-3-2.png new file mode 100644 index 0000000..b1155a5 Binary files /dev/null and b/README_files/figure-html/unnamed-chunk-3-2.png differ diff --git a/README_files/figure-html/unnamed-chunk-3-3.png b/README_files/figure-html/unnamed-chunk-3-3.png new file mode 100644 index 0000000..0faa94b Binary files /dev/null and b/README_files/figure-html/unnamed-chunk-3-3.png differ diff --git a/README_files/figure-html/unnamed-chunk-3-4.png b/README_files/figure-html/unnamed-chunk-3-4.png new file mode 100644 index 0000000..403a8af Binary files /dev/null and b/README_files/figure-html/unnamed-chunk-3-4.png differ diff --git a/README_files/figure-html/unnamed-chunk-3-5.png b/README_files/figure-html/unnamed-chunk-3-5.png new file mode 100644 index 0000000..e875d4f Binary files /dev/null and b/README_files/figure-html/unnamed-chunk-3-5.png differ diff --git a/README_files/figure-html/unnamed-chunk-3-6.png b/README_files/figure-html/unnamed-chunk-3-6.png new file mode 100644 index 0000000..c8dd6f0 Binary files /dev/null and b/README_files/figure-html/unnamed-chunk-3-6.png differ diff --git a/README_files/figure-html/unnamed-chunk-3-7.png b/README_files/figure-html/unnamed-chunk-3-7.png new file mode 100644 index 0000000..5f11cbf Binary files /dev/null and b/README_files/figure-html/unnamed-chunk-3-7.png differ diff --git a/README_files/figure-html/unnamed-chunk-3-8.png b/README_files/figure-html/unnamed-chunk-3-8.png new file mode 100644 index 0000000..45621b9 Binary files /dev/null and b/README_files/figure-html/unnamed-chunk-3-8.png differ diff --git a/README_files/figure-html/unnamed-chunk-3-9.png b/README_files/figure-html/unnamed-chunk-3-9.png new file mode 100644 index 0000000..c08ff2d Binary files /dev/null and b/README_files/figure-html/unnamed-chunk-3-9.png differ