Barplot
wrapper_bar_plot_core.Rd
Generate a signle barplot.
Usage
wrapper_bar_plot_core(
data,
x_var,
y_var,
y_type = "Proportion",
facet_var = NULL,
rev = FALSE,
colors_bar = NULL,
color_border = "black",
variable_names = NULL,
title = TRUE,
subtitle = TRUE,
xlab = TRUE,
ylab = TRUE,
legend_colors_title = TRUE,
legend_position = "right",
facet_label_both = TRUE,
skip_levels = NULL,
method = "facet",
show_proportions = TRUE,
show_counts = TRUE,
show_subtotal_proportions = FALSE,
show_subtotal_counts = FALSE,
show_total_counts = FALSE,
label_size = 4,
label_angle = 0,
label_nudge = 0.025,
title_size = NULL,
strip_text_size = NULL,
facet_scales = "fixed",
ylim = NULL,
axis_text_x_angle = 0,
axis_text_x_vjust = 1,
axis_text_x_hjust = 0.5,
aspect_ratio = NULL,
background_grid_major = "none"
)
wrapper_bar_plot_core_strat(
data,
x_var,
y_var,
y_type = "Proportion",
facet_var = NULL,
rev = FALSE,
strat1_var = NULL,
strat2_var = NULL,
colors_bar = NULL,
color_border = "black",
variable_names = NULL,
title = TRUE,
xlab = TRUE,
ylab = TRUE,
strat1_label_both = TRUE,
strat2_label_both = TRUE,
legend_colors_title = TRUE,
legend_position = "right",
facet_label_both = TRUE,
skip_levels = NULL,
method = "facet",
show_proportions = TRUE,
show_counts = TRUE,
show_subtotal_proportions = FALSE,
show_subtotal_counts = FALSE,
show_total_counts = FALSE,
label_size = 4,
label_angle = 0,
label_nudge = 0.025,
title_size = NULL,
strip_text_size = NULL,
facet_scales = "fixed",
ylim = NULL,
axis_text_x_angle = 0,
axis_text_x_vjust = 1,
axis_text_x_hjust = 0.5,
aspect_ratio = NULL,
background_grid_major = "none",
strat_scales = "fixed",
strat1_nrow = 1,
strat1_ncol = NULL,
strat2_nrow = NULL,
strat2_ncol = 1,
less_legends = FALSE
)
Arguments
- data
Data frame.
- y_type
Possible values: "Proportion" or "Count"
- method
One of the methods: c("facet", "dodge_facet", "dodge_facet2", "facet2", "dodge")
- strat1_var
Name of the first stratification variable.
- strat2_var
Name of the second stratification variable.
Examples
data(bdata)
data <- bdata
data$GeneA_cat2 <- wrapper_cut_2groups(data$GeneA)
x_var = "GeneA_cat2"
y_var = "Response"
wrapper_bar_plot_core(data = data, x_var = x_var, y_var = y_var)