Skip to content

Commit

Permalink
Merge pull request #1298 from AramburuMerlos/patch-1
Browse files Browse the repository at this point in the history
Update extract.R
  • Loading branch information
rhijmans authored Sep 28, 2023
2 parents e468317 + 3ffe98e commit c4a5ad7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/extract.R
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ extract_table <- function(x, y, ID=FALSE, weights=FALSE, exact=FALSE, touches=FA
fixname <- FALSE
e[,i] <- as.factor(e[,i])
}
tb <- aggregate(e[,i,drop=FALSE], e[,1,drop=FALSE], table)
tb <- cbind(tb[,1,drop=FALSE], tb[,2,drop=FALSE])
tb <- table(e[,1], e[,i])
tb <- cbind(ID = rownames(tb), as.data.frame.matrix(tb))
if (fixname) colnames(tb) <- gsub(cn[i], "", colnames(tb))
if (!ID) {
tb$ID <- NULL
Expand Down

0 comments on commit c4a5ad7

Please sign in to comment.