Using dplyr summarise with conditions
问题 I am currently trying to apply the summarise function in order to isolate the relevant observations from a large data set. A simple reproducible example is given here: df <- data.frame(c(1,1,1,2,2,2,3,3,3), as.logical(c(TRUE,FALSE,TRUE,TRUE,TRUE,TRUE,FALSE,TRUE,FALSE)), as.numeric(c(0,5,0,0,0,0,7,0,7))) colnames(df) <- c("ID", "Status", "Price") ID Status Price 1 1 TRUE 0 2 1 FALSE 5 3 1 TRUE 0 4 2 TRUE 0 5 2 TRUE 0 6 2 TRUE 0 7 3 FALSE 7 8 3 TRUE 0 9 3 FALSE 7 I would like to sort the table