Hi! I'm working with a large data set that has multiple observations per id. Basically, there's one observation per collected sample. I'm trying to filter by "patients" that sent a sample within a number of days (before and/or after) of a positive result. Roughly my data looks like this:
id age sample date sample site result
1 1 10/14/2022 0 0
1 1 10/25/2022 1 0
1 1 11/1/2022 1 1
1 1 11/8/2022 1 0
2 9 09/27/2022 1 0
2 9 10/15/2022 1 1
2 9 10/24/2022 0 0
3 4 9/22/2022 1 1
3 4 10/05/2022 1 0
Could you help me figure out how to get this data?