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

Preserve order of factors in gg_season() and gg_suberies() #165

Open
pasahe opened this issue Jun 19, 2024 · 0 comments
Open

Preserve order of factors in gg_season() and gg_suberies() #165

pasahe opened this issue Jun 19, 2024 · 0 comments

Comments

@pasahe
Copy link

pasahe commented Jun 19, 2024

Hello,

Facets created when using gg_season() and gg_subseries() on a tsibble with a factor in its keys are not ordered on the levels of the factor. Here is some reproducible code based on the example documentation of gg_subseries()

tsibbledata::aus_retail |> 
  filter(
    Industry == "Cafes, restaurants and catering services"
  ) |> 
  mutate(
    State = forcats::fct_infreq(State)
  ) |>
  gg_subseries(Turnover)

I have reordered the State variable based on the frequency of its values, but the facets are still ordered alphabetically ignoring the order of the levels.

Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant