I am trying to count records on summarize given conditions as the code bellow but it is not working. I am trying to count total rows, not a distinct count.
What am I doing wrong?
library(dplyr)
data %>%
group_by(UNIT) %>%
summarize(TOTAL = n(),
SLA = n(DATETIME[TYPE=='A' || TYPE=='B']))
Appreciate any help