ct2env: Establishing the relationship between CT and a environmental...

Description Usage Arguments Value Examples

View source: R/ct2env.R

Description

This function applies the approach: "circulation types to environment".

Usage

1
ct2env(x, clas, fun = mean, out = "data.frame")

Arguments

x

data.frame. A data.frame containing the environmental data (i.e. precipitation, temperature, PM10, etc.) with the following variables: lon, lat, time, value, anom_value. See tidy_nc.

clas

data.frame. A data.frame of the synoptic classification (time and WT) obtained from the synoptclas function.

fun

function. A function to be applied to the environmental variable for each WT.

out

character. Choose between "data.frame" (default) or "raster" A function to be applied to the environmental variable for each WT.

Value

a data.frame or a Raster Stack containing the environmental grids based on the weather types.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Load data (mslp or precp_grid)
data(mslp)
data(z500)
# Tidying our atmospheric variables (500 hPa geopotential height
# and mean sea level pressure) together.

# Time subset between two dates
atm_data1 <- tidy_nc(x = list(mslp,z500),
             name_vars = c("mslp","z500"))

# S-mode classification
smode_clas <- synoptclas(atm_data1, ncomp = 6)

# ct2env (precipitation example)
ct2env(x = pcp, clas = smode_clas$clas, fun = mean, out = "data.frame")

synoptReg documentation built on April 22, 2021, 1:06 a.m.

Related to ct2env in synoptReg...