how.many {normalizeH}R 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)

[Package normalizeH version 1.0.0 Index]