Skip to content

Commit

Permalink
Merge pull request #319 from r-spatialecology/fixes_lsm_p_gyrate
Browse files Browse the repository at this point in the history
adds fix
  • Loading branch information
mhesselbarth authored Mar 25, 2024
2 parents d1cf934 + 16b4e2e commit 78e071c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/lsm_p_gyrate.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)])
Expand Down

0 comments on commit 78e071c

Please sign in to comment.