Skip to content

Commit 9fe8fa1

Browse files
committed
Restore required sapply() in aggspec()
1 parent b0f4957 commit 9fe8fa1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

R/aggspec.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,10 @@ aggspec <- function(rspecdata, by = NULL, FUN = mean, trim = TRUE) {
9595
by <- factor(by) # is this necessary?
9696

9797
# Convert to data.frame now as to retain ALTREP wl when using cbind() later
98-
dat <- as.data.frame(vapply(unique(by), function(z) {
98+
# nolint next: undesirable_function_linter. Since FUN can have return of length > 1
99+
dat <- data.frame(sapply(unique(by), function(z) {
99100
apply(y[which(by == z)], 1, FUN)
100-
}, numeric(nrow(y))))
101+
}))
101102

102103
colnames(dat) <- unique(by0)
103104

0 commit comments

Comments
 (0)