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:
+usa_composite
: Retreive a U.S. composite map, optionally with a projectionus_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", package="albersusa")
- composite GeoJSONdevtools::install_github("hrbrmstr/albersusa")
+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)
+
+library(albersusa)
+library(testthat)
+
+date()
+## [1] "Mon Mar 28 16:25:47 2016"
+test_dir("tests/")
+## testthat results ========================================================================================================
+## OK: 0 SKIPPED: 0 FAILED: 0
+