% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RcppRoll.R
\name{RcppRoll-exports}
\alias{RcppRoll-exports}
\alias{roll_mean}
\alias{roll_meanr}
\alias{roll_meanl}
\alias{roll_median}
\alias{roll_medianr}
\alias{roll_medianl}
\alias{roll_min}
\alias{roll_minr}
\alias{roll_minl}
\alias{roll_max}
\alias{roll_maxr}
\alias{roll_maxl}
\alias{roll_prod}
\alias{roll_prodr}
\alias{roll_prodl}
\alias{roll_sum}
\alias{roll_sumr}
\alias{roll_suml}
\alias{roll_sd}
\alias{roll_sdr}
\alias{roll_sdl}
\alias{roll_var}
\alias{roll_varr}
\alias{roll_varl}
\title{RcppRoll}
\usage{
roll_mean(
  x,
  n = 1L,
  weights = NULL,
  by = 1L,
  fill = numeric(0),
  partial = FALSE,
  align = c("center", "left", "right"),
  normalize = TRUE,
  na.rm = FALSE
)

roll_meanr(
  x,
  n = 1L,
  weights = NULL,
  by = 1L,
  fill = NA,
  partial = FALSE,
  align = "right",
  normalize = TRUE,
  na.rm = FALSE
)

roll_meanl(
  x,
  n = 1L,
  weights = NULL,
  by = 1L,
  fill = NA,
  partial = FALSE,
  align = "left",
  normalize = TRUE,
  na.rm = FALSE
)

roll_median(
  x,
  n = 1L,
  weights = NULL,
  by = 1L,
  fill = numeric(0),
  partial = FALSE,
  align = c("center", "left", "right"),
  normalize = TRUE,
  na.rm = FALSE
)

roll_medianr(
  x,
  n = 1L,
  weights = NULL,
  by = 1L,
  fill = NA,
  partial = FALSE,
  align = "right",
  normalize = TRUE,
  na.rm = FALSE
)

roll_medianl(
  x,
  n = 1L,
  weights = NULL,
  by = 1L,
  fill = NA,
  partial = FALSE,
  align = "left",
  normalize = TRUE,
  na.rm = FALSE
)

roll_min(
  x,
  n = 1L,
  weights = NULL,
  by = 1L,
  fill = numeric(0),
  partial = FALSE,
  align = c("center", "left", "right"),
  normalize = TRUE,
  na.rm = FALSE
)

roll_minr(
  x,
  n = 1L,
  weights = NULL,
  by = 1L,
  fill = NA,
  partial = FALSE,
  align = "right",
  normalize = TRUE,
  na.rm = FALSE
)

roll_minl(
  x,
  n = 1L,
  weights = NULL,
  by = 1L,
  fill = NA,
  partial = FALSE,
  align = "left",
  normalize = TRUE,
  na.rm = FALSE
)

roll_max(
  x,
  n = 1L,
  weights = NULL,
  by = 1L,
  fill = numeric(0),
  partial = FALSE,
  align = c("center", "left", "right"),
  normalize = TRUE,
  na.rm = FALSE
)

roll_maxr(
  x,
  n = 1L,
  weights = NULL,
  by = 1L,
  fill = NA,
  partial = FALSE,
  align = "right",
  normalize = TRUE,
  na.rm = FALSE
)

roll_maxl(
  x,
  n = 1L,
  weights = NULL,
  by = 1L,
  fill = NA,
  partial = FALSE,
  align = "left",
  normalize = TRUE,
  na.rm = FALSE
)

roll_prod(
  x,
  n = 1L,
  weights = NULL,
  by = 1L,
  fill = numeric(0),
  partial = FALSE,
  align = c("center", "left", "right"),
  normalize = TRUE,
  na.rm = FALSE
)

roll_prodr(
  x,
  n = 1L,
  weights = NULL,
  by = 1L,
  fill = NA,
  partial = FALSE,
  align = "right",
  normalize = TRUE,
  na.rm = FALSE
)

roll_prodl(
  x,
  n = 1L,
  weights = NULL,
  by = 1L,
  fill = NA,
  partial = FALSE,
  align = "left",
  normalize = TRUE,
  na.rm = FALSE
)

roll_sum(
  x,
  n = 1L,
  weights = NULL,
  by = 1L,
  fill = numeric(0),
  partial = FALSE,
  align = c("center", "left", "right"),
  normalize = TRUE,
  na.rm = FALSE
)

roll_sumr(
  x,
  n = 1L,
  weights = NULL,
  by = 1L,
  fill = NA,
  partial = FALSE,
  align = "right",
  normalize = TRUE,
  na.rm = FALSE
)

roll_suml(
  x,
  n = 1L,
  weights = NULL,
  by = 1L,
  fill = NA,
  partial = FALSE,
  align = "left",
  normalize = TRUE,
  na.rm = FALSE
)

roll_sd(
  x,
  n = 1L,
  weights = NULL,
  by = 1L,
  fill = numeric(0),
  partial = FALSE,
  align = c("center", "left", "right"),
  normalize = TRUE,
  na.rm = FALSE
)

roll_sdr(
  x,
  n = 1L,
  weights = NULL,
  by = 1L,
  fill = NA,
  partial = FALSE,
  align = "right",
  normalize = TRUE,
  na.rm = FALSE
)

roll_sdl(
  x,
  n = 1L,
  weights = NULL,
  by = 1L,
  fill = NA,
  partial = FALSE,
  align = "left",
  normalize = TRUE,
  na.rm = FALSE
)

roll_var(
  x,
  n = 1L,
  weights = NULL,
  by = 1L,
  fill = numeric(0),
  partial = FALSE,
  align = c("center", "left", "right"),
  normalize = TRUE,
  na.rm = FALSE
)

roll_varr(
  x,
  n = 1L,
  weights = NULL,
  by = 1L,
  fill = NA,
  partial = FALSE,
  align = "right",
  normalize = TRUE,
  na.rm = FALSE
)

roll_varl(
  x,
  n = 1L,
  weights = NULL,
  by = 1L,
  fill = NA,
  partial = FALSE,
  align = "left",
  normalize = TRUE,
  na.rm = FALSE
)
}
\arguments{
\item{x}{A numeric vector or a numeric matrix.}

\item{n}{The window size. Ignored when \code{weights} is non-\code{NULL}.}

\item{weights}{A vector of length \code{n}, giving the weights for each
element within a window. If \code{NULL}, we take unit weights of width \code{n}.}

\item{by}{Calculate at every \code{by}-th point rather than every point.}

\item{fill}{Either an empty vector (no fill), or a vector (recycled to)
length 3 giving left, center and right fills.}

\item{partial}{Compute windows at the edges of \code{x} over however
many elements are in range, rather than filling them? Cannot be
combined with \code{weights}, and \code{fill} does not apply.}

\item{align}{Align windows on the \code{"left"}, \code{"center"} or
\code{"right"}.}

\item{normalize}{Normalize window weights, such that they sum to \code{n}.}

\item{na.rm}{Remove missing values?}
}
\description{
Efficient windowed / rolling operations. Each function
here applies an operation over a moving window of
size \code{n}, with (customizable) weights specified
through \code{weights}.
}
\details{
The functions postfixed with \code{l} and \code{r}
are convenience wrappers that set \strong{l}eft
/ \strong{r}ight alignment of the windowed operations.
}
