Description Usage Arguments Value Examples

Changes the frequency of a time series. By default, incomplete periods of regular series are omitted.

1 | ```
ts_frequency(x, to = "year", aggregate = "mean", na.rm = FALSE)
``` |

`x` |
ts-boxable time series, an object of class |

`to` |
desired frequency, either a character string ( |

`aggregate` |
character string, or function. Either |

`na.rm` |
logical, if |

a ts-boxable time series, with the same class as the input.

1 2 3 4 5 6 7 8 | ```
ts_frequency(cbind(mdeaths, fdeaths), "year", "sum")
ts_frequency(cbind(mdeaths, fdeaths), "quarter", "last")
ts_frequency(AirPassengers, 4, "sum")
# Note that incomplete years are omited by default
ts_frequency(EuStockMarkets, "year")
ts_frequency(EuStockMarkets, "year", na.rm = TRUE)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.