Permalink
Browse files

Ensure all columns of same length

  • Loading branch information...
1 parent b763abd commit a2f34cfa3614d0a27fb1e03f954b974cbfe8f7c5 @hadley committed Apr 13, 2009
Showing with 6 additions and 0 deletions.
  1. +6 −0 R/rbind.r
View
6 R/rbind.r
@@ -43,6 +43,12 @@ rbind.fill <- function(...) {
if (length(df[[var]]) > 0) output[[var]][rng] <- df[[var]]
}
}
+
+ # Ensure all variables are the same length. They might not be if the
+ # last data frame does not contain all rows.
+ for(var in names(output)) {
+ length(output[[var]]) <- sum(rows)
+ }
as_df(output)
}

0 comments on commit a2f34cf

Please sign in to comment.