Plot validation LISA indicators on user-supplied boundaries
Source:R/plot_validation.R
plot_validation_lisa_map.RdMaps residual-derived Local Moran/LISA cluster classes returned by
validate_flow_residual_structure(local_moran = TRUE). The function requires
users to supply sf boundary objects because debiasR does not ship,
download, or infer spatial boundaries. Optional outline boundaries can be
supplied for larger administrative areas.
Usage
plot_validation_lisa_map(
structure_results,
boundaries,
boundary_area_col = "area",
area_col = "area",
comparisons = "adjusted_vs_benchmark",
methods = NULL,
method_col = "method",
method_labels = NULL,
cluster_col = "lisa_cluster",
p_value_col = "p_value",
p_value_threshold = 0.05,
palette = NULL,
missing_fill = "#F3F4F6",
boundary_colour = NA,
boundary_linewidth = 0,
outline_boundaries = NULL,
outline_colour = "white",
outline_linewidth = 0.45
)Arguments
- structure_results
A data frame containing LISA map data, one
validate_flow_residual_structure()result, or a named list of results. The data must containlisa_cluster, which is produced whenvalidate_flow_residual_structure(local_moran = TRUE).- boundaries
User-supplied
sfpolygon or multipolygon object with one row per area to map.- boundary_area_col
Column in
boundariesidentifying areas. Default"area".- area_col
Column in the validation map data identifying areas. Default
"area".- comparisons
Flow comparison(s) to plot. Defaults to
"adjusted_vs_benchmark". Use"all"whenstructure_resultscontains several comparison rows.- methods
Optional character vector of method identifiers or display labels to include. Default
NULLincludes all methods.- method_col
Column containing the method identifier. Default
"method".- method_labels
Optional named character vector used to relabel methods.
- cluster_col
Column containing LISA cluster classes. Default
"lisa_cluster".- p_value_col
Column containing Local Moran/LISA p-values. Default
"p_value".- p_value_threshold
Numeric threshold used to display statistically significant LISA clusters. Areas with p-values above this threshold are shown as not significant. Set
NULLto plotcluster_colwithout p-value masking. Default0.05.- palette
Optional named or unnamed character vector of colours for LISA clusters. Defaults to the supplied validation review palette plus neutral greys for non-significant or undefined areas.
- missing_fill
Fill colour for boundaries that are not present in the validation results. Default
"#F3F4F6".- boundary_colour
Boundary line colour for mapped areas. Default
NAavoids drawing small-area internal borders.- boundary_linewidth
Boundary line width for mapped areas. Default
0.- outline_boundaries
Optional user-supplied
sfobject for larger administrative boundaries to draw over the mapped areas.- outline_colour
Larger-boundary outline colour. Default
"white".- outline_linewidth
Larger-boundary outline width. Default
0.45.