| test_fisher | R Documentation |
Performs Fisher's Exact Test using two categorical vectors or a data frame with two columns, constructing a contingency table and optionally generating graphical visualizations.
test_fisher(
x,
y = NULL,
title = "Fisher's Exact Test",
xlab = NULL,
ylab = NULL,
style = c("stacked", "barplot", "mosaic", "pie"),
colors = NULL,
show_table = TRUE,
help = FALSE,
verbose = TRUE
)
x |
Categorical vector or data frame with two columns. |
y |
Categorical vector (required if x_var is a vector). |
title |
Plot title (string). Default: "Fisher's Exact Test" |
xlab |
Name of the x-axis in the plot (string). Default: NULL (uses variable name). |
ylab |
Name of the y-axis in the plot (string). Default: "Proportion". |
style |
Plot style. Controls the visualization type. |
colors |
Character. Optional plot colors. |
show_table |
Logical. If TRUE, prints the contingency table to the console. Default: |
help |
Logical. If |
verbose |
Logical. If |
Invisible object containing the Fisher test result.
data <- data.frame(control = c(rep("healthy", 1), rep("sick", 5)),
treatment = c(rep("healthy", 5), rep("sick", 1)))
test_fisher(data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.