plot_posterior_bar: Barplot of posterior model probabilities

View source: R/plot_mediation.R

plot_posterior_barR Documentation

Barplot of posterior model probabilities

Description

This function takes posterior probability results from mediation_bf() and plots barplots of posterior model probabilities.

Usage

plot_posterior_bar(
  bmediatR_object,
  med_annot = NULL,
  mediator_id,
  med_var = "protein.id",
  stack = FALSE,
  bar_col = c("seagreen4", "seagreen1", "skyblue", "goldenrod1", "goldenrod4", "gray"),
  relabel_x = NULL,
  add_number_labels = FALSE,
  label_size = 5,
  num_dig = 3,
  main = NULL
)

Arguments

bmediatR_object

Output from bmediatR().

med_annot

Annotation data for -omic mediators.

mediator_id

Which mediator to plot posterior model probabilities for.

med_var

DEFAULT: "protein.id". The column in med_annot to be used as a mediator id.

stack

DEFAULT: FALSE. If TRUE, a stacked barplot is produced. If FALSE, a staggered barplot is produced.

add_number_labels

DEFAULT: FALSE. Add posterior probabilities as text above bars.

label_size

DEFAULT: 5. Text size of probability labels, when included.

num_dig

DEFAULT: 3. The number of digits after the decimal point if probabilities are being included as labels.

Examples

plot_posterior_bar()

wesleycrouse/bmediatR documentation built on April 28, 2023, 4:01 p.m.