national_sk_map: Reserve National Map with Seasonal Kendall Results

Description Usage Arguments Details Value Author(s) References Examples

View source: R/national_sk_map.R

Description

Create a base map for NERRS reserves in ggplot with seasonal kendall results

Usage

1
2
3
4
5
6
7
8
national_sk_map(
  incl = c("contig", "AK", "HI", "PR"),
  highlight_states = NULL,
  sk_reserves = NULL,
  sk_results = NULL,
  sk_fill_colors = c("#444E65", "#A3DFFF", "#247BA0", "#0a0a0a"),
  agg_county = TRUE
)

Arguments

incl

chr vector to include AK, HI , and PR (case sensitive)

highlight_states

chr vector of state FIPS codes

sk_reserves

chr vector of 3 letter reserve codes that have seasonal kendall results

sk_results

chr vector of seasonal kendall results. Results can be 'inc', 'dec', 'insig', or 'insuff' which stand for 'increasing trend', 'decreasing trend', 'statistically insignificant trend', or 'insufficient data to detect trend'

sk_fill_colors

chr vector of colors used to fill seasonal kendall result markers

agg_county

logical, should counties be aggregated to the state-level? Defaults to TRUE

Details

Create a base map of the US with options for including AK, HI, and PR. The user can choose which states and NERRS reserves to highlight. An early sp-based version of this function by Julie Padilla was developed, in part, from a blog post by Bob Rudis. The current sf-based version, by Dave Eslinger, uses an approach from the r-spatial tutorial by Mel Moreno and Mathieu Basille.

To ensure the proper plotting of results, the order of the results vector for sk_results should match the order of the reserves vector for sk_reserves.

Value

Returns a ggplot object

Author(s)

Julie Padilla, Dave Eslinger Maintainer: Dave Eslinger

References

Rudis, Bob. 2014. "Moving The Earth (well, Alaska & Hawaii) With R". rud.is (blog). November 16, 2014. https://rud.is/b/2014/11/16/moving-the-earth-well-alaska-hawaii-with-r/ Moreno, Mel, and Basille, Mathieu Basille. 2018. "Drawing beautiful maps programmatically with R, sf and ggplot2 — Part 3: Layouts" r-spatial (blog). October 25, 2018. https://www.r-spatial.org/r/2018/10/25/ggplot2-sf-3.html

Examples

1
2
3
4
5
6
7
8
9
##National map highlighting west coast states and NERRS (including AK)
nerr_states_west <- c('02', '06', '41', '53')

nerrs_codes <- c('pdb', 'sos', 'sfb', 'elk', 'tjr', 'kac')

nerrs_sk_results <- c('inc', 'inc', 'dec', 'insig', 'insuff', 'dec')

national_sk_map(highlight_states = nerr_states_west,
                sk_reserve = nerrs_codes, sk_results = nerrs_sk_results)

padilla410/SWMPrExtension documentation built on Dec. 29, 2021, 5:48 a.m.