I have a large data set in a df, included is a sample of the df.
I am trying to figure out the best way to take all the rows of df from every 5 rows and store them in a new df. So wavelength 350, wavelength 355, etc.. and all the other columns and corresponding rows that are in the df included in that 5 step interval. Wavelength is the main field to use for the intervals.
structure(list(wavelength = 350:360, albedo = c(0.88046, 0.88089,
0.88125, 0.88135, 0.88156, 0.88184, 0.88217, 0.88224, 0.88208,
0.88211, 0.88231), date = structure(c(17970, 17970, 17970, 17970,
17970, 17970, 17970, 17970, 17970, 17970, 17970), class = "Date"),
location2 = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L), .Label = "gc1", class = "factor"), albedo_corr = c(0.900254852108277,
0.900659453953826, 0.900988637085391, 0.90103193598839, 0.90126832240164,
0.901613616766539, 0.901975071632926, 0.902042155285601,
0.901846492887525, 0.90185458010468, 0.902082926871999),
cat2 = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L), .Label = "Open", class = "factor")), row.names = c(NA,
11L), class = "data.frame")