Skip to content

Commit

Permalink
Fixed bug in dfBind (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
BartJanvanRossum committed Aug 12, 2021
1 parent 57cf702 commit 21c48d1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,12 @@ chkRowCol <- function(dat) {
#' @noRd
#' @keywords internal
dfBind <- function(dfList) {
## Filter empty data.frames from dfList
dfList <- Filter(f = function(x) nrow(x) > 0, x = dfList)
## Remove empty data.frames from dfList
for (i in rev(seq_along(dfList))) {
if (nrow(dfList[[i]]) == 0) {
dfList[[i]] <- NULL
}
}
if (length(dfList) == 0) {
return(data.frame())
}
Expand Down

0 comments on commit 21c48d1

Please sign in to comment.