Rfast (version 1.7.3)

Count the frequency of a value: Count the frequency of a value

Description

Count the frequency of a value.

Usage

count_value(x, value)

Arguments

x
A vector with the data.
value
A value to check how many times v exists in the vector x.

Value

Counts how many times a value exists in a vector in linear time.

Details

The functions is written in C++ in order to be as fast as possible.

See Also

med, binary_search

Examples

Run this code
x <- rnorm(10000)
value <- x[500]
system.time( b <- count_value(x,value) )

Run the code above in your browser using DataLab