Skip to contents

Convert a SpatRaster from the terra package to a data.frame formatted in the way required by synoptReg .

Usage

as_synoptReg(x)

Arguments

x

SpatRaster time series containing the atmospheric data (e.g. mean sea level pressure).

Value

A data.frame with the following variables: x, y, time, value, var, units

See also

Examples

# Load data
slp_file <- system.file("extdata", "mslp_ei.nc", package = "synoptReg")

# Reading data
slp <- read_nc(slp_file)

# Converting it to the required structure by synoptReg
slp_df <- as_synoptReg(slp)