Splits observations by a cut on each of two columns. With the default labels, `"I"` is x and y both at or above their cuts, `"II"` x below and y at or above, `"III"` both below and `"IV"` x at or above and y below (the mathematical numbering). A value exactly on a cut belongs to the "at or above" side.
Usage
classify_quadrants(
data,
x_col,
y_col,
x_cut = 0,
y_cut = 0,
labels = c("I", "II", "III", "IV"),
quadrant_col = "quadrant"
)Examples
d <- classify_quadrants(mtcars, "wt", "mpg", x_cut = 3.2, y_cut = 20)
table(d$quadrant)
#>
#> I II III IV
#> 1 13 2 16
