read_brickman: Easy Brickman ncdf data into stars, tibble or sf objects

View source: R/io.R

read_brickmanR Documentation

Easy Brickman ncdf data into stars, tibble or sf objects

Description

Lazily fixes variable names to drop "d" prefix and "_ann" suffix which permits user to request variables ala "SST", "SSS" etc regardless of scenario.

Usage

read_brickman(
  scenario = c("RCP45", "RCP85", "PRESENT")[1],
  year = c(2055, 2075, NA)[1],
  vars = c("SST", "SSS"),
  interval = c("ann", "mon")[1],
  path = get_path("nc"),
  verbose = FALSE,
  add = NULL,
  crs = list("native", sf::st_crs(4362))[[1]],
  form = c("stars", "tibble", "sf")[1]
)

Arguments

scenario

character, (case insensitive) one of 'RCP45', 'RCP85', or 'PRESENT'

year

integer or character, the year to read, ignored if scenario is 'PRESENT'

vars

character, variable names (leading "d" and no trailing "_ann")

interval

character, on of "ann" or "mon"

path

character, the root path to the data

verbose

logical, if TRUE output messages

add

stars object or NULL If not NULL then add this to the result. Note, Bathy_depth, land_mask, nav_lon and nav_lat variables are excluded, and only variables common to both the add and the file read are added.

crs

character or class crs. If not "native" then the raster is transformed using stars::st_warp(). Defaults to "native" which returns the native curvilinear grid. Use sf::st_crs(4326) for longlat.

form

character, one of 'stars' (default), 'tibble' or 'sf' to control output form

Examples

## Not run: 
present <- read_brickman(scenario = "PRESENT")
rcp45_2075 <- read_brickman(year = 2075, form = "tibble", add = present)

## End(Not run)

BigelowLab/brickman documentation built on April 22, 2024, 9:26 p.m.