From 9bebf4f6774313a0cdfc279b42709df8fe27264d Mon Sep 17 00:00:00 2001 From: David Young Date: Tue, 16 Jan 2024 10:30:01 -0800 Subject: [PATCH] Fix missing hulls when concave polygons are not generated for groups (#312) --- R/mark_hull.R | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/R/mark_hull.R b/R/mark_hull.R index 07136118..7d5b2be8 100644 --- a/R/mark_hull.R +++ b/R/mark_hull.R @@ -306,6 +306,11 @@ makeContent.hull_enc <- function(x) { } concaveman::concaveman(mat, x$concavity, 0) }, xx = x_new, yy = y_new) + # ensure that all polygons have the same set of column names + polygons <- lapply(polygons, function(x) { + colnames(x) <- c("x", "y") + return(x)} + ) mark$id <- rep(seq_along(polygons), vapply(polygons, nrow, numeric(1))) polygons <- vec_rbind(!!!polygons) mark$x <- unit(polygons[, 1], 'mm')