Description Usage Arguments Details Value Author(s) See Also Examples
This function allows for the aggregation of non-continuos time series data into years. It allows for the multiple years to be specified. The aggregation method is also allowed to be set by the user. It also allows for the aggregation block to start at first observation or from the start of the year.
1 |
data |
A |
process |
An aggregation method. See |
multiple |
An integer specifying the aggregation block. Default |
na.rm |
Default is na.rm=FALSE. |
from.first.obs |
Wether the years start from the first observation or from the beginning of the year. Default is from.first.obs=TRUE. |
This function is based on the aggregate
method. It is designed to simplify the process of aggregating non-continuos data.
Returns a data.frame with dates formatted as as.Date
and aggregated data.
Jason Lessels <jason.lessels@sydney.edu.au>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ##Load the foo 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 years from first observation
year.mean <-yearsAgg(foo.ts,mean)
plot(year.mean)
##Now plot the min mean and max on one plot.
year.min <-yearsAgg(foo.ts,min)
year.max <-yearsAgg(foo.ts,max)
ymin=min(year.min$data);ymax=max(year.max$data)
plot(year.mean,ylim=c(ymin,ymax))
lines(year.min,type="l",lty=3,col="red")
lines(year.max,type="l",lty=3,col="blue")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.