Description Usage Arguments Details Value Author(s) Examples
Compares each feasible element of a vector to a given number of previous elements and computes the relative frequency of successes, where a success occurs in case of positive equality comparison.
1 | previous_equal(x, previous = 10)
|
x |
A numeric vector. |
previous |
The number of previous elements compared to the actual element. |
For each element of x
greater than previous
,
a success is recorded when it is equal to the last previous
elements,
where equality is assessed by all.equal
.
Relative frequency of possible successes as decribed in the Details section.
J. Gross, A. Moeller.
1 2 3 | x <- c(1, 1, 2, 1, 2, 2, 2, 3)
previous_equal(x, previous = 1) # 3/7
previous_equal(x, previous = 2) # 1/6
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.