FindTriples | R Documentation |
FindTriples
returns the number of left triples, right triples, and triples that are neither left nor right for the given vector.
FindTriples(z)
z |
Numeric vector |
Triples are formed by taking any three data values from a vector and order this triple of data values from smallest to largest. If the middle ordered item is closer to the smallest than to the largest, the triple is said to be a right triple. If the middle ordered item is closer to the largest, the triple is said to be a left triple. If the middle ordered value is exactly halfway between the other two, the triple is neither right nor left. This function will do the necessary computations and return the number of each type of triple.
A list with three components:
right
- Number of right triples (where middle value is closer to smallest)
left
- Number of left triples (where middle value is closer to largest)
neither
- Number of triples that are neither left nor right (where middle value is exactly halfway between the other two)
FindTriples(1:10)
FindTriples(rnorm(20))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.