This helper function is a wrapper for findInterval to extract classes from a "classInterval" object

findCols(clI)

Arguments

clI

a "classIntervals" object

Value

an integer vector of class indices

See also

Examples

if (!require("spData", quietly=TRUE)) { message("spData package needed for examples") run <- FALSE } else { run <- TRUE } if (run) { data(jenks71, package="spData") fix5 <- classIntervals(jenks71$jenks71, n=5, style="fixed", fixedBreaks=c(15.57, 25, 50, 75, 100, 155.30)) print(fix5) }
#> style: fixed #> one of 3,921,225 possible partitions of this variable into 5 classes #> [15.57,25) [25,50) [50,75) [75,100) [100,155.3] #> 6 34 42 14 6
if (run) { print(findCols(fix5)) }
#> [1] 3 4 4 3 4 4 4 4 5 5 5 5 4 4 3 4 4 4 4 5 3 4 3 3 4 3 3 3 3 5 3 3 3 3 3 3 3 #> [38] 3 3 3 2 3 3 2 3 3 2 3 3 2 3 3 3 3 3 3 3 3 2 3 2 3 3 3 2 2 3 3 2 2 2 2 2 3 #> [75] 2 2 2 2 3 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 1 1 2 1 1 1 2 2