Learn R Programming

rgeoda (version 0.0.6)

natural_breaks: Natural Breaks (Jenks)

Description

Natural Breaks group data whose boundaries are set where there are relatively big differences.

Usage

natural_breaks(k, data)

Arguments

k

A numeric value indicates how many breaks

data

A vector of numeric values

Value

A vector of numeric values of computed breaks

Examples

Run this code
# NOT RUN {
guerry_path <- system.file("extdata", "Guerry.shp", package = "rgeoda")
guerry <- geoda_open(guerry_path)
guerry_df <- as.data.frame(guerry) # use as data.frame
crm_prs <- guerry_df['Crm_prs'][,1] # get values of variable "crm_prs"
natural_breaks(k=5, data=crm_prs)
# }

Run the code above in your browser using DataLab