% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/DailyAno.R
\name{DailyAno}
\alias{DailyAno}
\title{Daily anomalies}
\usage{
DailyAno(data, dates = NULL, storefreq = "daily", jdays = NULL,
  timedim = NULL, na.rm = TRUE, ncores = NULL)
}
\arguments{
\item{data}{A numeric n-dimensional array of data including one time dimension.}

\item{dates}{A vector of dates if \code{jdays} is not supplied. If NULL (by default), the 'time' attributes of parameter 'data' are considered.}

\item{storefreq}{The time frequency of input data. Can be 'daily' (default) or 'monthly'.}

\item{jdays}{A vector of the corresponding day of the year. This vector must be the same length as the time dimension of the parameter \code{data}.}

\item{timedim}{An integer number indicating the position of the time dimension in the parameter \code{data}. If NULL (by default), use the dimension called 'time' or 'dates' in parameter \code{data}.}

\item{na.rm}{A logical indicating whether missing values should be removed. If \code{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.}

\item{ncores}{The number of cores to be used when computing the index.}
}
\value{
A named array of time anomalies of the same dimension as parameter \code{data}.
}
\description{
This function computes temporal anomalies from a vector containing time series.
}
\examples{
# Two-year data array:
data <- rnorm(2 * 3 * 731 * 2, 2, 1)
dim(data) <- c(lon = 2, lat = 3, time = 365 + 366, model = 2)
time <- seq(ISOdate(1903,1,1), ISOdate(1904,12,31), "days")
metadata <- list(time = list(standard_name = 'time', long_name = 'time',
                            calendar = 'standard',
                            units = 'days since 1970-01-01 00:00:00', prec = 'double',
                            dim = list(list(name ='time', unlim = FALSE))))
attr(time, 'variables') <- metadata
attr(data, 'Variables')$dat1$time <- time
attr(data, 'Variables')$dat2$time <- time
attr(data, 'Variables')$common[[2]]$dim[[3]]$len <- length(time)
attr(data, 'Variables')$common[[2]]$dim[[3]]$vals <- time

a <- DailyAno(data, timedim = 3, na.rm = TRUE, ncores = NULL)
str(a)
}

