findCols | R Documentation |
This helper function is a wrapper for findInterval
to extract classes from a "classInterval" object
findCols(clI, factor = FALSE)
clI |
a "classIntervals" object |
factor |
default "FALSE", if "TRUE" returns cols as a factor with intervals as labels |
an integer vector of class indices
Roger Bivand <Roger.Bivand@nhh.no>
classIntervals
, findInterval
xvar <- c(22361, 9573, 4836, 5309, 10384, 4359, 11016, 4414, 3327, 3408,
17816, 6909, 6936, 7990, 3758, 3569, 21965, 3605, 2181, 1892,
2459, 2934, 6399, 8578, 8537, 4840, 12132, 3734, 4372, 9073,
7508, 5203)
findCols(classIntervals(xvar, 5, "sd"), factor = FALSE)
findCols(classIntervals(xvar, 5, "sd"), factor = TRUE)
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)
}
if (run) {
print(findCols(fix5))
print(findCols(fix5, factor = TRUE))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.