This function creates a boxplot to compare a variable between sexes and saves the plot to a specified directory.
Examples
var <- "example_var"
estimate_df <- data.frame(
var = rep("example_var", 6),
sex = c("M", "F", "M", "F", "M", "F"),
akp_effect = c(0.5, -0.6, 0.7, -0.8, 0.9, -1.0),
p_adjust = c(0.01, 0.02, 0.03, 0.04, 0.05, 0.06)
)
plot_df <- data.frame(
sex = c("M", "F", "M", "F", "M", "F"),
example_var = c(1, 9, 6, 5, 4, 3)
)
output_dir <- tempdir()
compSex(var, estimate_df, plot_df, output_dir)