geocs_raster {geocomplexity} | R Documentation |
This function calculates geocomplexity for spatial raster data based on geographical similarity.
geocs_raster(r, order = 1, normalize = TRUE, similarity = 1, method = "spvar")
r |
|
order |
(optional) The order of the adjacency object. Default is |
normalize |
(optional) Whether to further normalizes the calculated geocomplexity.
Default is |
similarity |
(optional) When |
method |
(optional) When |
A SpatRaster
object
In contrast to the geocs_vector()
function, the geocs_raster()
performs operations
internally on raster data without providing additional wt object.
library(terra)
m1 = matrix(c(3,3,3,3,1,3,
3,3,3,2,1,2,
3,3,3,1,2,1,
1,3,2,2,2,2,
2,2,2,1,1,2,
1,2,1,1,1,1),
nrow = 6,
byrow = TRUE)
m1 = rast(m1)
names(m1) = 'sim1'
m2 = m1
set.seed(123456789)
values(m2) = values(m1) + runif(ncell(m1),-1,1)
names(m2) = 'sim2'
m = c(m1,m2)
gc1 = geocs_raster(m,1)
gc2 = geocs_raster(m,2)
gc1
plot(gc1)
gc2
plot(gc2)