library(lubridate)
#>
#> Attaching package: 'lubridate'
#> The following object is masked from 'package:base':
#>
#> date
library(feasts)
#> Loading required package: fabletools
#>
#> Attaching package: 'fabletools'
#> The following object is masked from 'package:stats':
#>
#> decompose
library(tsibble)
#>
#> Attaching package: 'tsibble'
#> The following objects are masked from 'package:lubridate':
#>
#> interval, new_interval
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following object is masked from 'package:tsibble':
#>
#> id
#> The following objects are masked from 'package:lubridate':
#>
#> intersect, setdiff, union
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
as_tsibble(USAccDeaths) %>%
index_by(year = year(index)) %>%
summarise(value = sum(value)) %>%
gg_subseries(value, period = 2)
#> Error: `yearweek()` doesn't know how to handle the numeric class yet.
MRE:
Created on 2019-12-03 by the reprex package (v0.2.1)