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

natural_breaks(k, df)

Arguments

k

A numeric value indicates how many breaks

df

A data frame with selected variable. E.g. guerry["Crm_prs"]

Value

A vector of numeric values of computed breaks

Examples

library(sf)
guerry_path <- system.file("extdata", "Guerry.shp", package = "rgeoda")
guerry <- st_read(guerry_path)
#> Reading layer `Guerry' from data source 
#>   `/Users/runner/work/_temp/Library/rgeoda/extdata/Guerry.shp' 
#>   using driver `ESRI Shapefile'
#> Simple feature collection with 85 features and 29 fields
#> Geometry type: MULTIPOLYGON
#> Dimension:     XY
#> Bounding box:  xmin: 47680 ymin: 1703258 xmax: 1031401 ymax: 2677441
#> Projected CRS: NTF (Paris) / Lambert zone II
natural_breaks(k=5, guerry['Crm_prs'])
#> [1]  9474 16722 23316 29872