daysAgg: Daily aggregation function

Description Usage Arguments Details Value Author(s) References Examples

Description

This function allows for the aggregation of non-continuos time series data into days. It allows for the multiple days to be specified. The aggregation method is also allowed to be set by the user.

Usage

1
daysAgg(data, process, multiple = NULL, na.rm = FALSE)

Arguments

data

A timeSeries formatted dataset.

process

An aggregation method. See aggregate.

multiple

An integer specifying the aggregation block. Default is multiple=NULL.

na.rm

Default is na.rm=FALSE.

Details

This function is based on the aggregate method. It is designed to simplify the process of aggregating non-continuos data.

Value

Returns a data.frame with dates formatted as as.Date and aggregated data.

Author(s)

Jason Lessels <jason.lessels@sydney.edu.au>

References

Returns a data.frame with dates formatted as as.Date and aggregated data.

Examples

1
2
3
4
5
6
7
8
#Load the data:
data(foo)
#Format the data using the timeSeries function.
foo.ts<-timeSeries(foo[,1],  "%d/%m/%Y  %H:%M",foo[,3])
#Aggregate the data into days using mean:
foo.1day<-daysAgg(foo.ts,mean)
#Aggregate the data into weeks, using 7 days and mean:
foo.week<-daysAgg(foo.ts,mean,7)

TSAgg documentation built on May 2, 2019, 6:09 p.m.

Related to daysAgg in TSAgg...