Skip to contents

countgtzero used in apply to count number >0 in a vector

Usage

countgtzero(invect)

Arguments

invect

vector of values

Value

A single value of number of values > 0

Examples

  set.seed(12346)
  x <- trunc(runif(10)*10)
  x
#>  [1] 9 5 4 1 8 8 0 5 1 6
  countgtzero(x)  # should be 9
#> [1] 9