Skip to content

Conversation

@jack-davison
Copy link
Collaborator

@jack-davison jack-davison commented Oct 14, 2025

This PR fixes #438.

timeProp() had a few random odds and sods in it that weren't being used, had some repetition, and a bit of "round-the-houses" ways of achieving certain things (e.g., colours). This PR simplifies and modernises a lot of this.

One obvious user-facing feature is the addition of key and rejigging the argument order to be more in line with timePlot(), which it now inherits a lot of its param definitions from.

A more subtle one is that proportion is now passed to type in checkPrep() rather than as a member of vars. This means you can pass "default" to it, which means you can create a bar chart out of basically any statistic as long as avg.time is the same as what you're starting with! This fixes the spirit of #122 via something like:

mydata |>
  selectByDate(year = 2000) |>
  rollingMean() |>
  timeAverage(avg.time = "day", statistic = "max") |>
  timeProp(
    pollutant = "rolling8o3",
    proportion = "default",
    avg.time = "day",
    sub = NA,
    key = FALSE
  )
Image

@jack-davison jack-davison marked this pull request as ready for review October 14, 2025 20:19
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.

Review timeProp()

1 participant