paired_plot: Quantify the effect of a treatment on a numeric variable

View source: R/paired.R

paired_plotR Documentation

Quantify the effect of a treatment on a numeric variable

Description

Produce a paired plot that represents the value of a numeric variable in the same individual before and after some treatment

Usage

paired_plot(
  data,
  y_var,
  group,
  direction = "horizontal",
  test = "paired",
  map_signif_level = TRUE,
  y_limits = c(-1, 1),
  trend_statistic = TREND_STATISTIC,
  error_statistic = ERROR_STATISTIC,
  colors = NULL,
  y_annotation = NULL,
  x_annotation = 1.5,
  text_hjust = 0.5,
  y_annotation_n = -1,
  text_y_size = TEXT_SIZE,
  title_y_size = TITLE_SIZE,
  starsize = STARSIZE,
  textsize = N_TEXT_SIZE,
  y_step = 0.5,
  expansion_y_bottom = EXPANSION_Y_BOTTOM,
  expansion_y_top = EXPANSION_Y_TOP,
  distribution_color = DISTRIBUTION_COLOR,
  linewidth = LINEWIDTH,
  point_size = POINT_SIZE,
  linewidth_mean = LINEWIDTH_MEAN,
  point_size_mean = POINT_SIZE_MEAN,
  family = FONT,
  vjust = VJUST,
  angle_n = 45,
  text_vjust = 0,
  offset = 0,
  correction = NULL,
  group_levels = NULL,
  drop = FALSE,
  alternative = "greater",
  y_label = NULL,
  n_y_ticks = NULL
)

Arguments

data

Data frame with columns:

  • y_var: numeric from -1 to 1

  • test: one of PRE or POST

  • id: unique to each animal. The same animal must have one PRE and one POST value, and no more

  • a column named according to the input argument 'group', used to separate animals by some category e.g. genotype, treatment, etc

group

A column in the data frame data, see argument data


shaliulab/idocr documentation built on June 1, 2025, 4:59 p.m.