Skip to content

Commit

Permalink
fixes #1442
Browse files Browse the repository at this point in the history
  • Loading branch information
rhijmans committed Mar 11, 2024
1 parent 53ec247 commit 700852c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/extract.R
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ extract_fun <- function(x, y, fun, ID=TRUE, weights=FALSE, exact=FALSE, touches=
}


do_fun <- function(x, e, fun, ...) {
do_fun <- function(e, fun, ...) {
fun <- match.fun(fun)
e <- aggregate(e[,-1,drop=FALSE], e[,1,drop=FALSE], fun, ...)
m <- sapply(e, NCOL)
Expand All @@ -213,7 +213,7 @@ do_fun <- function(x, e, fun, ...) {
if (length(cn) == ncol(e)) {
colnames(e) <- cn
}
#e <- data.frame(e)
e <- data.frame(e)
}
e
}
Expand Down Expand Up @@ -291,7 +291,7 @@ function(x, y, fun=NULL, method="simple", cells=FALSE, xy=FALSE, ID=TRUE, weight
colnames(e) <- cn
if (!is.null(fun)) {
e <- as.data.frame(e)
e <- do_fun(x, e, fun, ...)
e <- do_fun(e, fun, ...)
}

if (cells) {
Expand Down

0 comments on commit 700852c

Please sign in to comment.