how.many: How many elements are TRUE in a logical vector

View source: R/normalizeH.R

how.manyR Documentation

How many elements are TRUE in a logical vector

Description

This function finds number of elements which are TRUE in a logical vector

Usage

how.many(x)

Arguments

x

A logical vector

Value

A non-negative integer of length 1.

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>

Examples

x <- c(1,-1,1,-1,1,-1)
how.many(x == -1)
how.many(seq(1,7,2) == 3)

normalizeH documentation built on July 21, 2022, 5:10 p.m.