Hello I am trying all the packages for the "landscape metrics" calculations, looking for a way to calculate an index that takes into account the presence of two classes of interest by passing a "moving window". "Landscapemetrics" does not have "CWED" with the possibility of giving weights to the adjacencies between classes, but I thought that by filtering the only two classes that interest me from time to time, I can calculate different indices for each pair of classes . Attached is a geotiff raster of an example of this raster. But if it doesn't work on this raster landscape: it doesn't give an error but can't complete the calculations. Maybe you need a "pad"? « >library(terra) >library(landscapemetrics) >habitat_arvaia_crop_raster_cl1_4_spatraster <- terra::rast("habitat_arvaia_raster_crop_1_4.tif") >scale_of_effect <- 5 >moving_window <- matrix(1, nrow = scale_of_effect, ncol = scale_of_effect) >lsm_l_relmutinf_5_cl1_4 <- window_lsm(habitat_arvaia_crop_raster_cl1_4_spatraster,window=moving_wi ndow,what = c("lsm_l_relmutinf"),fun=mean,na.rm=T) » Thanks P.S.: R 4.04 (debian 11) landscapemetrics 1.5.4 terra 1.4-22 -- agricultural technician Enrico Gabrielli
_______________________________________________ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology