I have a dataset with approx 10.000 rows and each row. This is the dataset, but with 10k rows.
dat <- data.frame(speed=c(1,2,3,4,5),cycle=c(1,2,2,3,4))
Is there any way to subset to for each different cycle for instance for cycle=1 I want to have one dataframe (for instance, dat_cycle1) and then I want to convert it to matrix it and use it as an input to a another function.
i tried something like
for (i in 1:nrow(dat) {dat[i] <- filter(dat, cycle==i)}
but not working.
Please elaborate your answer.