tidyverts / tsibble

Tidy Temporal Data Frames and Tools
https://tsibble.tidyverts.org
GNU General Public License v3.0
528 stars 50 forks source link

Add fullseq method for year* variants #198

Closed mitchelloharawild closed 4 years ago

mitchelloharawild commented 4 years ago

The date_breaks parameter cannot be used with ggplot2 scales for tsibble time classes.

library(tsibble)
#> Warning: package 'tsibble' was built under R version 3.6.3
library(ggplot2)
as_tsibble(USAccDeaths) %>% 
  ggplot(aes(x = index, y = value)) + 
  geom_line() + 
  scale_x_yearmonth(date_breaks = "2 years", date_labels = "%Y")
#> Error in UseMethod("fullseq"): no applicable method for 'fullseq' applied to an object of class "c('yearmonth', 'vctrs_vctr')"

Created on 2020-06-18 by the reprex package (v0.3.0)

earowang commented 4 years ago

Now the arguments are passed to scale_x_continuous(), and _date() doesn’t give nice default breaks anymore. Maybe you can have some suggestions on this.

I’ll submit a patch version soon.

Cheers, Earo

On 18 Jun 2020, at 16:16, mitchelloharawild wrote:

The date_breaks parameter cannot be used with ggplot2 scales for tsibble time classes.

library(tsibble)
#> Warning: package 'tsibble' was built under R version 3.6.3
library(ggplot2)
as_tsibble(USAccDeaths) %>%
  ggplot(aes(x = index, y = value)) +
  geom_line() +
  scale_x_yearmonth(date_breaks = "2 years", date_labels = "%Y")
#> Error in UseMethod("fullseq"): no applicable method for 'fullseq' 
applied to an object of class "c('yearmonth', 'vctrs_vctr')"

Created on 2020-06-18 by the reprex package (v0.3.0)

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/tidyverts/tsibble/issues/198