From 16b4e2efe229fdd41e00ff6bbddab359149deb81 Mon Sep 17 00:00:00 2001 From: Jakub Nowosad Date: Sat, 23 Mar 2024 18:30:12 +0100 Subject: [PATCH] adds fix --- R/lsm_p_gyrate.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/lsm_p_gyrate.R b/R/lsm_p_gyrate.R index 7d2a9beae..e06ccdbb2 100644 --- a/R/lsm_p_gyrate.R +++ b/R/lsm_p_gyrate.R @@ -105,7 +105,9 @@ lsm_p_gyrate_calc <- function(landscape, directions, cell_center, resolution, ex # get (relative) coordinates of current class points <- which(!is.na(landscape_labeled), arr.ind = TRUE) - points <- mapply(FUN = `*`, as.data.frame(points), resolution) + dim_points <- dim(points) + points <- mapply(FUN = `*`, data.frame(points), resolution) + dim(points) <- dim_points # set ID from class ID to unique patch ID points <- cbind(points, landscape_labeled[!is.na(landscape_labeled)])