Dynamic statistical comparisons in R