nhs-r-community / NHSRplotthedots

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

Add option to label limits and mean using secondary y axis #188

Closed francisbarton closed 10 months ago

francisbarton commented 1 year ago

This submission adds a label_limits Boolean flag to ptd_create_ggplot(). When turned on, this flag will add a secondary y axis to the plot, with labels that indicate the values of the UCL, LCL and mean. This is in response to issue #141 .

Suggestions for better names for the flag are welcomed.

The fork currently fails against 1 lintr criterion: cyclomatic complexity. By adding the new flag, another set of option combinations has now been added to the ptd_create_ggplot() function, which gives it a complexity value of 23, with the current linter limit set to 20.

Further changes included in this PR:

I have also done some code tidying:

This will also close issue #187 if accepted.

tomjemmett commented 12 months ago

thanks! I think we need to merge #180 and #182 first. These are probably going to cause some merge conflicts by looking at the comparison's of the branches - hopefully these should be too problematic!

francisbarton commented 12 months ago

Thanks Tom. I think most of the issues will be 'stylistic' like linting, line length, and the use of dplyr:: etc prefixes. Possibly an issue around adoption of the base pipe.

tomjemmett commented 10 months ago

I've attempted to resolve conflicts. If they fail will revert my commit and have another look!

tomjemmett commented 10 months ago

going to merge and apply some fixes in another PR. many thanks @francisbarton !