In this data I would like to create a new data frame with cycle (this is my identifier) column and another two columns one has the sum of my N variable by cycle and another that has sum of N where the element of classifier column is equal to valid column.
set.seed(1)
test <- tibble(cicle = c(rep("1", 10), rep("2", 10), rep("3", 10)),
classifier = rep(c("c1", "c2", "c3"), 10),
valid = rep(c("c3", "c2", "c4"), 10),
N = rnorm(30))
How could I perform it?
Thank you