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

Control timeVariation() lower panels #383

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jack-davison
Copy link
Collaborator

This PR adds the panels argument to timeVariation().

It allows users to control the order and presence of the lower three panels of the timeVariation() plot.

Notes:

  • This supersedes month.last, which now doesn't do anything. It's still listed as an argument, but users just get a warning to use panels instead.

  • You can't provide nothing to panels (i.e., you can't just get the day.hour panel on it's own). The best way to isolate a panel is to just run timeVariation() and pull it from the openair object.

  • I can think of two key benefits to dropping panels:

    • If only one month of data has been used, the month panel often looks rubbish so could just be dropped.
    • If the hour panel doesn't provide greater insight compared to to the hour.day panel, it too could be dropped.
  • This adds space for more panels, if there was future interest. For example, a daylight panel, or season panel.

devtools::load_all()
#> ℹ Loading openair

# default
timeVariation(mydata, "pm10")

# rejig the bottom panel
timeVariation(mydata, "pm10", panels = c("month", "day", "hour"))

# what if only one month of data is being used? looks crap
timeVariation(selectByDate(mydata, month = 1, year = 2000),
              "pm10",
              panels = c("month", "day", "hour"))

# get rid of the month panel
timeVariation(selectByDate(mydata, month = 1, year = 2000),
              "pm10",
              panels = c("day", "hour"))

Created on 2024-04-28 with reprex v2.0.2

@jack-davison jack-davison marked this pull request as draft April 29, 2024 13:06
@jack-davison
Copy link
Collaborator Author

Converted this to draft as I need to understand how the xlab argument works and interacts with this!

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

Successfully merging this pull request may close these issues.

1 participant