|
48 | 48 | #' Default has been chosen to avoid red and green which can lead to subconscious value judgements of good or bad. |
49 | 49 | #' Default is hex colours: c("#FF7F0EFF", "#FF7F0EFF", "#1F77B4FF","#1F77B4FF", "#9467BDFF", "#9467BDFF", "#2CA02CFF", "#2CA02CFF") |
50 | 50 | #' @param SHMI_rounding TRUE/FALSE, for SHMI calculation (standardised ratio, with SHMI truncation etc.), should you round the expected values to 2 decimal places (TRUE) or not (FALSE) |
51 | | -#' @param max.overlaps Exclude text labels that overlap too many things. Defaults to 10. (inheritted from geom_label_repel) |
| 51 | +#' @param max.overlaps Exclude text labels that overlap too many things. Defaults to 10. (inherited from geom_label_repel) |
52 | 52 | #' |
53 | 53 | #' @return A fitted `funnelplot` object. A `funnelplot` object is a list containing the following components:\cr |
54 | 54 | #' \item{print}{Prints the number of points, outliers and whether the plot has been adjusted, and prints the plot} |
@@ -122,8 +122,8 @@ funnel_plot <- function(.data, numerator, denominator, group |
122 | 122 | , multiplier = 1, x_label = "Expected" |
123 | 123 | , y_label , x_range = "auto", y_range = "auto" |
124 | 124 | , plot_cols = |
125 | | - c("#FF7F0EFF", "#1F77B4FF" |
126 | | - , "#9467BDFF", "#2CA02CFF") |
| 125 | + c("#FF7F0EFF", "#FF7F0EFF", "#1F77B4FF","#1F77B4FF", |
| 126 | + "#9467BDFF", "#9467BDFF", "#2CA02CFF", "#2CA02CFF") |
127 | 127 | , theme = funnel_clean() |
128 | 128 | , label_outliers, Poisson_limits, OD_adjust |
129 | 129 | , xrange, yrange |
@@ -194,7 +194,7 @@ funnel_plot <- function(.data, numerator, denominator, group |
194 | 194 |
|
195 | 195 |
|
196 | 196 | if(length(plot_cols) < 8){ |
197 | | - stop("Please supply a vector of 4 colours for funnel limits, in order: 95% Lower Poisson, 95% Upper Poisson |
| 197 | + stop("Please supply a vector of 8 colours for funnel limits, in order: 95% Lower Poisson, 95% Upper Poisson |
198 | 198 | , 99.8% Lower Poisson, 99.8% Upper Poisson, 95% Upper OD-adjusted, 95% Lower OD-adjusted, |
199 | 199 | 99.8% Lower OD-adjusted, 99.8% Upper OD-adjusted, even if you are only using one set of limits.") |
200 | 200 | } |
|
0 commit comments