events2station: Transform an 'event' object into a 'station' object

View source: R/events2station.R

events2stationR Documentation

Transform an 'event' object into a 'station' object

Description

Aggregate some aspects of an 'events' object in time and space and transform the time series into a 'station' object.

Usage

events2station(
  x,
  param = "count",
  FUN = "mean",
  verbose = FALSE,
  longname = NULL,
  unit = NULL,
  ...
)

Arguments

x

input object of class 'events'

param

parameter to aggregate, e.g., 'count' or some characteristic such as 'pcent' or 'radius' (for options, see names(x))

FUN

a function, e.g., 'mean' or 'sum'

verbose

a boolean; If TRUE print information about progress

longname

long name of variable

unit

name of unit

...

additional arguments

by.trajectory

a boolean; This input is only used when param is 'count'. See description above.

by

the time interval of aggregation, only used when param is 'count'. The default is "month", other options are "year", "day", and "timestep". When param is not 'count', by cannot be changed and the aggregation is always on a monthly time scale.

Details

If the aggregated aspect is the number of events (param='count', the default option), the events can be aggregated in several different ways. The frequency of aggregation can be set by the input parameter 'by' (default: "month"). If by.trajectory=FALSE (default), the function counts the average number of events per timestep at the selected interval. If by.trajectory=TRUE, the function instead counts the number of individual trajectories that are identified within that time period. The latter option requires 'track' to have been applied to the events.

Value

a 'station' object


metno/esd documentation built on Feb. 25, 2025, 6:44 p.m.