find_triples | R Documentation |
A general-purpose function to count how many triples of numerics occur in a vector within a fixed interval of one another.
find_triples
will begin a searching for the next triple at the index of the
final member of the most recently found triple.
find_triples(x, from = 4.0, to = 12.0)
x |
a vector of type numeric |
from |
a numeric lower bound for the length between two observations |
to |
a numeric upper bound for the length between two observations |
An integer representing the number of triples.
Sandy Floren
# 1 triple
find_triples(c(0, 4, 12, 16))
# No triples
find_triples(c(0, 12, 25))
# 2 triples
find_triples(c(0, 12, 24, 36, 48))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.