I have a data frame for which I want to plot a boxplot to compare observations at different conditions.
But when I plot it, the lines that connect the data points across both boxplots are completely wrong:
if(!require(ggpubr)) {install.packages('ggpubr')} else {library(ggpubr)}
df = structure(list(y = c(1, 1, 1, 1, 2, 2),
group = c("a", "a" , "b", "b", "c", "c"),
x = c("alpha", "beta", "alpha", "beta","alpha", "beta")),
class = "data.frame",
row.names = c(NA, -6L))
ggpaired(data = df, x = 'x', y = 'y')
As you can see, the lines connecting the lines should be horizontal, as the values do not change across conditions; but instead, they connect randomly to each other.