Learn R Programming

amadeus (version 1.2.3)

process_prism: Process PRISM data

Description

This function imports and cleans raw PRISM data, returning a single SpatRaster object.

Reads time series or 30-year normal PRISM data.

Usage

process_prism(path = NULL, element = NULL, time = NULL, extent = NULL, ...)

Value

a SpatRaster object with metadata of time and element.

Arguments

path

character giving PRISM data path Both file and directory path are acceptable.

element

character(1). PRISM element name

time

character(1). PRISM time name. Should be character in length of 2, 4, 6, or 8. "annual" is acceptable.

extent

numeric(4) or SpatExtent giving the extent of the raster if NULL (default), the entire raster is loaded

...

Placeholders.

Author

Insang Song

See Also

terra::rast, terra::metags

Examples

Run this code
## NOTE: Example is wrapped in `\dontrun{}` as function requires a large
##       amount of data which is not included in the package.
if (FALSE) {
prism <- process_prism(
  path = "./data/PRISM_ppt_stable_4kmM3_202104_nc.nc",
  element = "ppt",
  time = "202104"
)
}

Run the code above in your browser using DataLab