Partitions data into blocks and and applies the specifed function to each of the bocks.

1 | ```
aggregateData(x, by, FUN, moving=FALSE, ...)
``` |

`x` |
a numeric vector. |

`by` |
. |

`FUN` |
a scalar function to compute the summary statistics which can be applied to all data subsets. |

`...` |
additional arguments to pass to FUN. |

`moving` |
either FALSE to do standard aggregation, or a positive integer N to perform a moving aggregation (normally used for a moving average) over N samples. |

the aggregated series.

`aggregate`

.

1 2 3 4 | ```
## Group a simple series into blocks containing 8
## elements, and take the mean of each block.
## Each block is lagged by 3 elements
aggregateData(1:30, by=3, FUN=mean, moving=8)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.