Skip to contents

Create a ggplot2 object with an arrow for each sample that spans from its pre-training to post-training value.

Usage

plot_pre_post(x, pre, post, stats = NULL, width = 0.8, angle = 20, scale = 1)

Arguments

x

data.frame with pre and post values. The data should be filtered to a specific age and sex.

pre

character; name of a column in x containing pre-training values.

post

character; name of a column in x containing post-training values.

stats

data.frame with post - pre stats for each training group. The data should be filtered to a specific measure, age, and sex.

width

numeric; value between 0 and 1 specifying the maximum width of the group with the most samples.

angle

numeric; angle of the arrow heads.

scale

numeric; scaling factor for text and other plot elements.

Value

A ggplot object.