I am trying to take my data frame, with nested data in the sac_EV column, and check the sampling rate variable to determine if I need to remove every other row from the unnested data. If the sampling_rate == 100 then I want to leave it alone. If the sampling_rate is 200 I want to get rid of every other row, essentially making it equivalent in size to the 100 sampling rate sets. I know this should be super simple, but for the life of me, I can't think of a simple function that will grab every other row that I can cleanly implement into my piping. Any and all help is greatly appreciated.
Data
I think this URL will automatically download the RDS file from my repository when you put it in your browser,
I expected to see a list of elements with 6001 rows each. However, some are still 12001 despite having a sampling rate of 200. Your function looks like it should have caught these cases though.
The goal is to do a bind_rows() at the end to bring this back into a singular data frame and renest the sac_EV column, good call on that. I think for that part I would use the dplyr::nest_by() function?