get_compactness: This is the main function in this package, and the only one...

View source: R/compactness_wrapper.R

get_compactnessR Documentation

This is the main function in this package, and the only one you should use normally.

Description

Estimates the compactness and two standard errors for each polygon in a shp file as per Kaufman, King, and Komisarchik (2018)

Usage

get_compactness(shp, namecol, verbose = TRUE, new.models = NULL)

Arguments

shp

The filename or filepath of a shp file containing district polygons.

namecol

The name, in quotes, of the variable in the shapefile containing each district's unique identifier

verbose

Default TRUE.

new.models

Default NULL. Should we generate predictions using the built-in model, or a new user-generated model?

Value

A data frame where rows correspond to the number of polygons in shp. The columns include the district identifier, the compactness score where high is less compact, and the standard errors.

Examples

get_compactness("CnclDist_July2012.shp", "NAME")

aaronrkaufman/compactness documentation built on June 11, 2025, 6:45 a.m.