Plot Bland-Altman statistics
A data frame
1st variable to compare (unquoted)
2nd variable to compare (unquoted)
data label (unquote)
grouping variable used for faceting (unquoted)
colour asthetic for scatter points (unquoted)
shape asthetic for scatter points (unquoted)
The text for the x-axis label
The text for the y-axis label
plot title
plot caption
alpha level for the intervals
ggplot2::ggplot object
library(tidyr)
tbl <- temperature %>% pivot_wider(names_from = method, values_from = temperature)
# simple example
ba_plot(data = tbl, var1 = infrared, var2 = rectal)
# with colors
ba_plot(data = tbl, var1 = infrared, var2 = rectal, colour = visit)
# with colors and faceting
ba_plot(data = tbl, var1 = infrared, var2 = rectal, group = treatment, colour = visit)