expand_apply: expand_apply

Description Usage Arguments Value Examples

View source: R/utils-rwl.R

Description

Apply a function on an expanding window.

Usage

1
expand_apply(x, FUN)

Arguments

x

a numeric vector (NA is allowed and will be omitted) or a data.frame/rwl object

FUN

character, name of a function e.g. 'median'.

...

additional arguments

Value

The form of the value depends on the class of x. returns a vector for default method, a data.frame for data.frame method.

Examples

1
2
3
4
5
6
7
#example for numeric method:
x <- c(NA, NA, 1, 3, 2, 3, NA)
expand_apply(x, 'median')
#example for data.frame method:
library('dplR')
data('ca533')
expand_apply(ca533, 'median')

konradmayer/trlboku documentation built on July 3, 2020, 9:49 p.m.