aboutsummaryrefslogblamecommitdiff
path: root/man/twa.Rd
blob: a3509cd8edc1316dc48e69dfda4217b6efbd1d37 (plain) (tree)


























                                                                      
                     
 
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/twa.R
\name{twa}
\alias{twa}
\alias{twa.one_box}
\title{Calculate a time weighted average concentration}
\usage{
twa(x, window = 21)

\method{twa}{one_box}(x, window = 21)
}
\arguments{
\item{x}{An object of type \code{\link{one_box}}}

\item{window}{The size of the moving window}
}
\description{
The moving average is built only using the values in the past, so
the earliest possible time for the maximum in the time series returned
is after one window has passed.
}
\examples{
pred <- sawtooth(one_box(10),
  applications = data.frame(time = c(0, 7), amount = c(1, 1)))
max_twa(pred)
}
\seealso{
\code{\link{max_twa}}
}

Contact - Imprint