Package 'slrcsap'

Title: Lightweight Tools to Create Sea Level Rise Projections for the Tampa Bay Region
Description: Lightweight tools to download data and create plots for sea level rise projections in the Tampa Bay region. Plots are produced to support recommendations of the Climate Science Advisory Panel facilitated by the Tampa Bay Estuary Program. Data are from NOAA Tides and Currents web page <https://tidesandcurrents.noaa.gov/> and the Interagency Sea Level Rise Scenario Tool <https://sealevel.nasa.gov/task-force-scenario-tool>.
Authors: Marcus Beck [aut, cre] (ORCID: <https://orcid.org/0000-0002-4996-0059>)
Maintainer: Marcus Beck <[email protected]>
License: MIT + file LICENSE
Version: 1.3.0
Built: 2026-05-23 08:52:00 UTC
Source: https://github.com/tbep-tech/slrcsap

Help Index


Get Sea Level Rise (SLR) scenario

Description

Get Sea Level Rise (SLR) scenario

Usage

get_scenario(
  id = 520,
  scenario = c("IntLow", "Int", "IntHigh"),
  method = "curl",
  quiet = TRUE
)

Arguments

id

numeric, gauge number. Default is 520 (St. Petersburg, FL).

scenario

character, SLR scenario. Default is 'IntLow', 'Int', and 'IntHigh' (NOAA Intermediate Low, Intermediate, and Intermediate High). See details for available options.

method

character, download method. Default is 'curl', passed to download.file().

quiet

logical, suppress download messages. Default is TRUE.

Details

Information from https://sealevel.nasa.gov/task-force-scenario-tool?psmsl_id=520, by default. Results are SLR in meters and feet for the intermediate low, intermediate, and intermediate high scenarios based on recommended scenarios from the Climate Science Advisory Panel. Full options for scenarios are 'Low', 'IntLow', 'Int', 'IntHigh', and 'High'. Values for SLR are relative change from 2020.

Value

A data frame with columns for id, scenario, year, SLR in meters, and SLR in feet.

Examples

dat <- get_scenario()
head(dat)

Get monthly Mean Sea Level (MSL) data for selected gauge

Description

Get monthly Mean Sea Level (MSL) data for selected gauge

Usage

get_sealevel(gauge = 8726520)

Arguments

gauge

numeric, gauge number. Default is 8726520 (St. Petersburg, FL).

Details

Information from https://tidesandcurrents.noaa.gov using the URL https://tidesandcurrents.noaa.gov/sltrends/data/8726520_meantrend.txt, by default. Results are monthly Mean Sea Level (MSL) in meters and feet, with the seasonal cycle removed.

Value

A data frame with columns for gauge, year, month, date, MSL in meters, and MSL in feet.

Examples

dat <- get_sealevel(gauge = 8726520)
head(dat)

Plot sea level scenario data

Description

Plot sea level scenario data

Usage

plot_scenario(
  dat,
  cols = c("deepskyblue", "orange", "red"),
  units = "ft",
  linewidth = 1,
  caption = TRUE,
  xrng = c(2020, 2100),
  xbrk = 10,
  yrng = NULL,
  ybrk = 7,
  plotly = FALSE
)

Arguments

dat

Input data from get_scenario().

cols

character, color palette for the lines. Default is c('deepskyblue', 'orange', 'red').

units

character, units for the y-axis. Default is 'ft'. Options are 'ft' and 'm'.

linewidth

numeric, line width. Default is 1.

caption

logical, add caption with source. Default is TRUE. Does not apply if plotly = TRUE.

xrng

numeric, x-axis range. Default is c(2020, 2100).

xbrk

numeric, number of x-axis breaks. Default is 10. Does not apply if plotly = TRUE.

yrng

numeric, y-axis range as two values. Default is NULL, which uses the range of the data.

ybrk

numeric, number of y-axis breaks. Default is 7. Does not apply if plotly = TRUE.

plotly

logical, if TRUE, returns a plotly object instead of ggplot. Default is FALSE.

Value

A ggplot object

Examples

dat <- get_scenario()
plot_scenario(dat)

Plot sea level data

Description

Plot sea level data

Usage

plot_sealevel(
  dat,
  col = "deepskyblue",
  units = "ft",
  caption = TRUE,
  xrng = NULL,
  xbrk = 10,
  yrng = NULL,
  ybrk = 5,
  plotly = FALSE
)

Arguments

dat

Input data from get_sealevel().

col

character, color for the line. Default is 'deepskyblue'.

units

character, units for the y-axis. Default is 'ft'. Options are 'ft' and 'm'.

caption

logical, add caption with source. Default is TRUE. Does not apply if plotly = TRUE.

xrng

Date, x-axis range as two values. Default is NULL, which uses the range of the data.

xbrk

numeric, number of x-axis breaks. Default is 10. Does not apply if plotly = TRUE.

yrng

numeric, y-axis range as two values. Default is NULL, which uses the range of the data.

ybrk

numeric, number of y-axis breaks. Default is 5. Does not apply if plotly = TRUE.

plotly

logical, if TRUE, returns a plotly object instead of ggplot. Default is FALSE.

Value

a ggplot object

Examples

dat <- get_sealevel()
plot_sealevel(dat)