Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: scales for ggplot2 #233

Open
TimTaylor opened this issue Jun 2, 2021 · 1 comment · May be fixed by #345
Open

Feature request: scales for ggplot2 #233

TimTaylor opened this issue Jun 2, 2021 · 1 comment · May be fixed by #345
Labels
feature a feature request or enhancement

Comments

@TimTaylor
Copy link

Is the plan to eventually be implementing scales for the various calendar objects (e.g. year_month_day)? I'm thinking maybe some sort of factor / categorical type scale would be appropriate depending on the precision?

@DavisVaughan DavisVaughan added the feature a feature request or enhancement label Jul 15, 2021
@mattwarkentin
Copy link

mattwarkentin commented Nov 24, 2022

I came here to ask the very same thing. It feels like this should work, but it doesn't. Would love for the addition of ggplot-friendly scales.

library(tidyverse)
library(clock)
library(nycflights13)

flights |> 
  select(year, month, day) |> 
  mutate(
    date = date_build(year, month, day),
    date = as_year_month_day(date),
    gp = calendar_group(date, 'day')
  ) |> 
  count(gp) |> 
  ggplot() +
  aes(gp, n) +
  geom_line()
#> Don't know how to automatically pick scale for object of type clock_year_month_day/clock_calendar/clock_rcrd/vctrs_rcrd/vctrs_vctr. Defaulting to continuous.
#> Error: Discrete value supplied to continuous scale

I was actually thinking it should be some sort of continuous type scale.

@DavisVaughan DavisVaughan added this to the 0.7.0 milestone Apr 27, 2023
@DavisVaughan DavisVaughan linked a pull request May 10, 2023 that will close this issue
@DavisVaughan DavisVaughan removed this from the 0.7.0 milestone May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants