apply.daily.columns: Columnwise apply a function to receive hourly or daily...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/apply.daily.columns.r

Description

Apply a specified function to each column of an xts object creating hourly or daily values

Usage

1
apply.daily.columns(x, FUN, agg = "day", PB = "n", tz = NULL, ...)

Arguments

x

an xts object

FUN

an R function

agg

character string 'day' or 'hour' to specifiy whether to receive daily or hourly values, respectivly

PB

a character indicating whether and what kind of progress bar should be drawn. See details.

tz

character specifying the time zone or NULL (the standard). If the latter, the time zone of x is used

...

additional arguments to FUN

Details

A simple mechanism to use apply.daily or apply.hourly to each column of an xts object.

By setting PB, an optional progressbar can be drawn: "w" or "win" draws a winProgressBar, "t" or "txt" draws a txtProgressBar and "n" or "none" (the default) suppresses the progressbar.

Value

An xts object containing daily values

Author(s)

Simon Frey

See Also

apply.daily

apply.hourly

Examples

1
2
3
4
5
6
7
8
 
    # load precipitation input
    data(precipitation)
    head(x)
    
    # aggregate to daily values
    aday <- apply.daily.columns(x, FUN = sum, agg = 'day', PB = 'txt')
    head(aday)

freysimon/TigR documentation built on March 4, 2020, 9:01 a.m.