count_val {cheapr} | R Documentation |
This is a programmer's version of sum(x == value)
to count the number of
occurrences of a value without creating a potentially large logical vector.
count_val(x, value, recursive = TRUE)
val_count(x, value, recursive = TRUE)
which_val(x, value, invert = FALSE)
x |
A vector, list, data frame or matrix. |
value |
A value with which to count the frequency of. |
recursive |
Should the function be applied recursively to lists? |
invert |
Should |
This is a generalisation of num_na()
and as such the identity
count_val(x, NA) == num_na(x)
will always hold.
A count of the number of times value
appears in x
.