Summarizing logical vectors (1)
- Summarizing the whole vector:
any()
,all()
: return a logicalsum()
,mean()
: return a numeric
- Summarizing a subset:
- apply a summary function to a subsetted vector
- If
NA
values are present, the summary result will beNA
, BUT theNA
values can also be ignored with:na.rm = TRUE
.