View source: R/transforms_time.R
count_if | R Documentation |
Increments a counter when the criteria is met
count_if(criteria, fill.na = T)
criteria |
A logical expression that is TRUE when the count should increment |
fill.na |
TRUE if NA values in criteria should be filled with FALSE or FALSE to leave them as NA. |
A vector with the running count of times the criteria has been met.
EVID=c(1,1,0,0,1,1,1,0)
CMT= c(1,2,1,2,1,2,NA,2)
count_if(EVID==1 & CMT==1)
count_if(EVID==1 & CMT==1, fill.na=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.