Skip to content

Commit

Permalink
Closes #1549. Fixed a case when fill=TRUE didn't work as expected.
Browse files Browse the repository at this point in the history
  • Loading branch information
arunsrinivasan committed Mar 1, 2016
1 parent d36a04f commit 61ba7df
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@

29. `last` function will now properly redirect method if `xts` is not installed or not attached on search path. Closes [#1560](https://github.com/Rdatatable/data.table/issues/1560).

30. `rbindlist` (and `rbind`) works as expected when `fill = TRUE` and the first element of input list doesn't have columns present in other elements of the list, [#1549](https://github.com/Rdatatable/data.table/issues/1549). Thanks to @alexkowa.

#### NOTES

1. Updated error message on invalid joins to reflect the new `on=` syntax, [#1368](https://github.com/Rdatatable/data.table/issues/1368). Thanks @MichaelChirico.
Expand Down
4 changes: 4 additions & 0 deletions inst/tests/tests.Rraw
Original file line number Diff line number Diff line change
Expand Up @@ -7418,6 +7418,10 @@ if(!requireNamespace("chron", quietly = TRUE)){
test(1602.4, class(as.chron.ITime(tt)), "times")
}

# fix for #1549
d1 <- data.table(v1=1:2,x=x)
d2 <- data.table(v1=3:4)
test(1603.1, rbindlist(list(d2, d1), fill=TRUE), rbindlist(list(d1,d2), fill=TRUE)[c(3:4, 1:2)])

##########################

Expand Down
2 changes: 1 addition & 1 deletion src/rbindlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ static void preprocess(SEXP l, Rboolean usenames, Rboolean fill, struct preproce
} else {
// Fix for #705, check attributes and error if non-factor class and not identical
if (!data->is_factor[i] &&
!R_compute_identical(thisClass, getAttrib(thiscol, R_ClassSymbol), 0)) {
!R_compute_identical(thisClass, getAttrib(thiscol, R_ClassSymbol), 0) && !fill) {
error("Class attributes at column %d of input list at position %d does not match with column %d of input list at position %d. Coercion of objects of class 'factor' alone is handled internally by rbind/rbindlist at the moment.", i+1, j+1, i+1, data->first+1);
}
type = TYPEOF(thiscol);
Expand Down

0 comments on commit 61ba7df

Please sign in to comment.