You can take sum of logical values to count how many of them are different than 1 for each day.
In base R :
aggregate(reliability~day, df, function(x) sum(x != 1))
dplyr
:
library(dplyr)
df %>%group_by(day) %>% summarise(counter = sum(reliability != 1))
and data.table:
library(data.table)
setDT(df)[, .(counter = sum(reliability != 1)), day]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…