I have the following dataframe:
df <- data.frame( time = factor(c(1, 1, 2, 2)), value = c(1, 5, 3, 4), group = factor(c(1, 2, 1, 2)), upper = c(1.1