dichotomy: Splits a vector into two classes

View source: R/dichotomy.R

dichotomyR Documentation

Splits a vector into two classes

Description

Splits (dichotomizes) a numeric vector into two classes using the "up-down" or "median" criteria. The results is intendend to be used in a runs test for tendency.

Usage

dichotomy(x, criteria = c("up-down", "median"))

Arguments

x

A numeric vector of values to split

criteria

Splitting criteria to use ("up-down" or "median")

Value

A vector with the splitted classes

References

Davis, J. C. (2002). Statistical and Data Analysis in Geology. 3rd ed. John Wiley & Sons.

Examples

x1 = c(17, 14, 13, 17, 9, 15, 36, 13, 26, 10, 25, 13, 25, 8, 28, 15, 19, 32, 22)
x2 = c(17, 14, 14, 17, 9, 15, 36, 13, 26, 10, 25, 13, 25, 8, 28, 15, 19, 32, 22)
dichotomy(x1)
dichotomy(x2)
dichotomy(x2, criteria = "median")


maxgav13/GMisc documentation built on June 12, 2022, 3:48 a.m.