I have a dataset that looks like this:
sample data can be build by
df<- structure(list(VISITNUM = c(4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,