join_count_ratio function

Join Count Ratio

Join Count Ratio

Join count ratio is the join counts, the number of times a category is surrounded by neighbors of the same category, over the total number of neighbors after converting each category to a dummy variable.

join_count_ratio(clusters, w)

Arguments

  • clusters: A cluster classification variable (categorical values from a dataframe or values returned from cluster functions)
  • w: An instance of Weight class

Returns

A data.frame with names "Cluster", "N", "Neighbors", "Join Count", "Ratio"

Examples

## Not run: library(sf) guerry_path <- system.file("extdata", "Guerry.shp", package = "rgeoda") guerry <- st_read(guerry_path) queen_w <- queen_weights(guerry) data <- guerry[c('Crm_prs','Crm_prp','Litercy','Donatns','Infants','Suicids')] clusters <- skater(5, queen_w, data) results <- join_count_ratio(clusters, queen_w) results ## End(Not run)