My data looks like this: structure(list(did = c(216L, 221L, 221L, 221L, 221L, 221L, 221L, 221L, 214L, 214L, 214L, 221L, 221L, 221L, 221L, 221L, 221L, 214L, 221L, 221L, 221L,