n_count | R Documentation |
The 'n_count' function calculates the number of occurrences of a specific value 'n' in a numeric vector 'x'.
n_count(x, n)
x |
Numeric vector in which to count occurrences. |
n |
Numeric value to count occurrences of. |
An integer representing the count of occurrences of 'n' in 'x'.
x <- c(1, 2, 3, 2, 4, 2)
n_count(x, 2) # Returns 3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.