rgeoda
rgeoda copied to clipboard
Example not reproducible
The join_count_ratio() function doc is not reproducible. This probably wasn't captured because the tests are wrapped in a \donttrun{}
(and I can't tell why? this example contains fully valid R code)
The correct example code is:
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$Clusters, queen_w)
results
https://github.com/GeoDaCenter/rgeoda/blob/94c17daf55f7da1ebb32f78516683bb9dfd7b444/R/clustering.R#L696-L706