DailyAno {ClimProjDiags}R Documentation

Daily anomalies

Description

This function computes daily anomalies from a vector containing the daily time series.

Usage

DailyAno(data, jdays = NULL, dates = NULL, calendar = NULL, na.rm = TRUE)

Arguments

data

A vector of daily data.

jdays

A vector of the corresponding day of the year. This vector must be the same length as parameter data.

dates

If jdays is not supplied, a vector of dates corresponding to the observations in data with defined calendar attributes.

calendar

A character indicating the calendar type.

na.rm

A logical indicating whether missing values should be removed. If na.rm is FALSE an NA value in any of the arguments will cause a value of NA to be returned, otherwise (TRUE by default) NA values are ignored.

Value

A vector of daily anomalies of the same length as parameter data.

Examples

# Time series in a vector example:
data <- 1:10
jdays <- c(rep(1, 5), rep(2, 5))
daily_anomaly <- DailyAno(data = data, jdays = jdays, na.rm = TRUE)
print(daily_anomaly)

[Package ClimProjDiags version 0.3.3 Index]