@@ -165,6 +165,7 @@ many_to_one_fisher_test <- function(xtab, ref.group = NULL, p.adjust.method = "h
165
165
# ' @param control_level The level to use as control (default: first level in the data)
166
166
# ' @param alternative Direction of the alternative hypothesis ("two.sided", "less", or "greater")
167
167
# ' @param conf.level Confidence level for the returned confidence interval
168
+ # ' @param p.adjust.method p-value adjustment method, passing to the stats function.
168
169
# '
169
170
# ' @return A data frame with factor levels and corresponding p-values
170
171
# ' @export
@@ -188,7 +189,8 @@ many_to_one_fisher_test <- function(xtab, ref.group = NULL, p.adjust.method = "h
188
189
compare_to_control_fisher <- function (data , factor_col , success_col , failure_col ,
189
190
control_level = NULL ,
190
191
alternative = " two.sided" ,
191
- conf.level = 0.95 ) {
192
+ conf.level = 0.95 ,
193
+ p.adjust.method = " holm" ) {
192
194
193
195
# Validate inputs
194
196
if (! all(c(factor_col , success_col , failure_col ) %in% colnames(data ))) {
@@ -256,7 +258,7 @@ compare_to_control_fisher <- function(data, factor_col, success_col, failure_col
256
258
}
257
259
258
260
# Add adjusted p-values
259
- fisher_results $ p_adjusted <- p.adjust(fisher_results $ p_value , method = " holm " )
261
+ fisher_results $ p_adjusted <- p.adjust(fisher_results $ p_value , method = p.adjust.method )
260
262
261
263
# Rename the level column to match the input factor column name
262
264
names(fisher_results )[names(fisher_results ) == " level" ] <- factor_col
0 commit comments