ssim_polygon {SSIMmap} | R Documentation |
The SSIM index for polygon maps.
Description
This function computes the SSIM, a measure of similarity between two polygon maps.
Usage
ssim_polygon(
shape,
map1,
map2,
standardize = TRUE,
bandwidth = NULL,
k1 = NULL,
k2 = NULL,
global = TRUE
)
Arguments
shape |
A |
map1 |
The name of the first map to compare as a column in the shape. |
map2 |
The name of the second map to compare as a column in the shape. |
standardize |
If TRUE, standardize the variables before computing the SSIM. Default is TRUE. |
bandwidth |
The size of bandwidth for the Gaussian kernel weighting used in the SSIM calculation. Default is the square root of N. |
k1 |
The constant used in the SSIM calculation. Default is NULL, in which case it is computed from the maximum value of the variables. |
k2 |
The constant used in the SSIM calculation. Default is NULL, in which case it is computed from the maximum value of the variables. |
global |
If global is TRUE, returning the global average of SSIM, SIM, SIV, and SIP. If the option is FALSE, a |
Details
This function computes the SSIM index for two polygon maps.
Value
If global is TRUE, returning the global average SSIM, SIM, SIV, and SIP on the console window.
If global is FALSE, a sf
object containing the SSIM, SIM, SIV, and SIP for each polygon.
Examples
# Load example sf object Toronto Area with three attributes for maps:
# Pampalon Index, CIMD Index,
# and percentage of household commuting within the same Census Sub-Division of residence.
data("Toronto")
# Mapping two attributes
plot(Toronto$CIMD_SDD)
plot(Toronto$PP_SDD)
# Finding global ssim
ssim_polygon(Toronto,"CIMD_SDD","PP_SDD")
df<-ssim_polygon(Toronto,"CIMD_SDD","PP_SDD",global=FALSE)