countLessThan(q, values, na.rm=F, weights=NULL, op = "<=")
TRUE
then missing values (
NA
) are removed from
values
and
weights
. If
FALSE
, any missing values call the result to be all
NA
s.
NULL
(signifying that raw counts are desired) or
a numeric vector the same length as
values
.
q
.
This has missing values where
q
is missing.
The function may also work for non-numeric vectors, such as character strings, where comparisons are well-defined. It should not be used for unordered factors.
countLessThan( 4:6, 1:10 ) x <- runif(100) countLessThan( c(-1, .2, .5, .8, 1.5), x ) countLessThan( c(-1, .2, .5, .8, 1.5), x , op = "<=") # same countLessThan( c(-1, .2, .5, .8, 1.5), x , op = ">") countLessThan( c(-1, .2, .5, .8, 1.5, NA), c(x, NA), na.rm=T) # The final answer is NA - NAs are removed from values and weights, not q