gg_season - double-label on x-axis

Hello,
When I use gg_season (in the feasts pkg) to plot tsibble data I often get x-axis labelling that adds a label twice or in the wrong place.
I've used the pedestrian dataset to illustrate but I have used other datasets and had similar labelling issues return.

Have other folks had this problem? If anyone knows how to resolve please let me know.
Thanks.

#> summing to daily
z <- index_by(pedestrian, Date) %>%
summarise(Count2 = sum(Count))

gg_season(z, y = Count2, period = 'year')

#>summing to weekly 
z2 <- index_by(pedestrian, yearweek(Date)) %>%
  summarise(Count2 = sum(Count))

gg_season(z2, y = Count2, period = 'year')

Is pedestrian a tsibble?

Fixed, thanks: https://github.com/tidyverts/feasts/commit/f7894e859fe0258122011ce5148282b121b0c0d1

library(fpp3)
#> ── Attaching packages ────────────────────────────────────────────── fpp3 0.3 ──
#> ✓ tibble      3.0.4          ✓ tsibble     0.9.3.9000
#> ✓ dplyr       1.0.2          ✓ tsibbledata 0.2.0     
#> ✓ tidyr       1.1.2          ✓ feasts      0.1.5.9000
#> ✓ lubridate   1.7.9          ✓ fable       0.2.1.9000
#> ✓ ggplot2     3.3.2
#> ── Conflicts ───────────────────────────────────────────────── fpp3_conflicts ──
#> x lubridate::date()   masks base::date()
#> x dplyr::filter()     masks stats::filter()
#> x tsibble::interval() masks lubridate::interval()
#> x dplyr::lag()        masks stats::lag()
#> summing to daily
z <- index_by(pedestrian, Date) %>%
  summarise(Count2 = sum(Count))

gg_season(z, y = Count2, period = 'year')

#>summing to weekly 
z2 <- index_by(pedestrian, yearweek(Date)) %>%
  summarise(Count2 = sum(Count))

gg_season(z2, y = Count2, period = 'year')

Created on 2020-11-16 by the reprex package (v0.3.0)

1 Like

Thanks Mitchell, your update is downloaded and working.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.