diff --git a/DESCRIPTION b/DESCRIPTION index cfbc8468..2a95b3ab 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: stars Title: Spatiotemporal Arrays, Raster and Vector Data Cubes -Version: 0.6-5 +Version: 0.6-6 Authors@R: c(person(given = "Edzer", family = "Pebesma", diff --git a/R/aggregate.R b/R/aggregate.R index 4406573f..be3cdc77 100644 --- a/R/aggregate.R +++ b/R/aggregate.R @@ -172,10 +172,10 @@ aggregate.stars = function(x, by, FUN, ..., drop = FALSE, join = st_intersects, dims = dim(d) agr_grps = function(x, grps, uq, FUN, ...) { - do.call(rbind, lapply(uq, function(i) { + do.call(cbind, lapply(uq, function(i) { sel <- which(grps == i) if (!isTRUE(any(sel))) - rep(NA_real_, ncol(x)) + NA_real_ else apply(x[sel, , drop = FALSE], 2, FUN, ...) }