You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: R/funnel_plot.R
+15-16Lines changed: 15 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -179,30 +179,23 @@ funnel_plot <- function(.data, numerator, denominator, group
179
179
180
180
181
181
# build initial dataframe of obs/predicted, with error message caught here in 'try'
182
-
182
+
# Main error check here, some moved after tidyeval mapping as they conflict.
183
183
if (missing(denominator)) {
184
-
stop("Need to specify model denominator")
184
+
stop("Need to specify denominator column")
185
185
}
186
186
if (missing(numerator)) {
187
-
stop("Need to supply numerator")
187
+
stop("Need to supply numerator column")
188
188
}
189
189
if (missing(title)) {
190
190
title<- ("Untitled Funnel Plot")
191
191
}
192
-
if (missing(numerator)) {
193
-
stop("Need to supply the column name for numerator")
194
-
}
192
+
195
193
196
-
if (class(denominator)[1] =="array") {
197
-
denominator<- as.numeric(denominator)
198
-
}
199
194
200
-
if(identical(numerator,denominator)){
201
-
stop("Numerator and denominator are the same. Please check your inputs")
202
-
}
203
-
204
-
if(length(plot_cols) <4){
205
-
stop("Please supply a vector of 4 colours for funnel limits, in order: 95% Poisson, 99.8% Poisson, 95% OD-adjusted, 99.8% OD-adjusted, even if you are only using one set of limits.")
195
+
if(length(plot_cols) <8){
196
+
stop("Please supply a vector of 4 colours for funnel limits, in order: 95% Lower Poisson, 95% Upper Poisson
0 commit comments