knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
haidagwaii
is an R data package that provides a spatial polygon object of the archipelago of Haida Gwaii, British Columbia called haida_gwaii
.
# load required packages library(haidagwaii) library(broom) library(ggplot2) # project as BC Albers haida_gwaii <- spTransform(haidagwaii::haida_gwaii, CRS("+init=epsg:3005")) # convert into data frame haida_gwaii <- broom::tidy(haida_gwaii) # map ggplot() + geom_polygon(data = haida_gwaii, aes(x = long / 1000, y = lat / 1000, group = group), fill = alpha("black", 1/2)) + coord_equal() + scale_x_continuous("Easting (km)") + scale_y_continuous("Northing (km)")
To install
# install.packages("devtools") devtools::install_github("poissonconsulting/haidagwaii")
The spatial polygon was derived from the bcmaps R package.
The original data are available from http://www12.statcan.gc.ca/census-recensement/2011/geo/bound-limit/files-fichiers/gcd_000b11a_e.zip.
Although licensed under the Statistics Canada Open Licence Agreement this does not constitute an endorsement by Statistics Canada.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.