nhs-r-community / NHSRplotthedots

An SPC package to support NHSE/I 'Making Data Count' programme
https://nhs-r-community.github.io/NHSRplotthedots/
Other
48 stars 23 forks source link

Y axis format (e.g. time MM:SS) #174

Closed las-luke-rogerson closed 1 year ago

las-luke-rogerson commented 1 year ago

This may be quite straightforward as is, but would appreciate some pointers.

It would be useful to include a parameter into the ptd_create_ggplot() function which allows the y axis format to be specified. In our tests of the package we are often looking at improvement in waiting times, where reporting in either minutes-seconds or hours-minutes is desirable. Decimal minutes is straightforward but rarely translates well to a non-statistical audience.

tomjemmett commented 1 year ago

the object returned by ptd_create_ggplot is just a ggplot object, so you can always do something like

ptd_create_ggplot(spc) +
  scale_y_continuous(...)

it may give a warning about replacing an existing axis, but that's fine to ignore.

adding too many arguments to the plot function will make it confusing, so I would favour utilising standard ggplot stuff where possible

las-luke-rogerson commented 1 year ago

Thanks Tom, I'll test that.