View source: R/aggregateDays2Months.R
aggregateDays2Months | R Documentation |
Aggregation of many Days over several years to Months is possible with this function
aggregateDays2Months(Time,Data,FUN,Header,Period="month", ...)
Time |
[1:n] vector of |
Data |
[1:n,1:d] matrix or dataframe, d can be also 1, then vector |
FUN |
aggregate by a function like |
Header |
colnames for data |
Period |
string defining the period, but only |
... |
further arguments passed on to |
A shortcut for aggregation using dplyr
dataframe[1:m,1:(d+1)] with m<n and first column being the time in as.Date
format
Michael Thrun
#Generating Data
data(Sales)
Time=seq(from=as.Date('1970-01-01'),by='1 day',length.out = 2*length(Sales))
#Aggregation
Monthly=aggregateDays2Months(Time,c(Sales,Sales),sum)
str(Monthly)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.