Skip to content

Commit

Permalink
rbind_all now handles list columns. closes #463
Browse files Browse the repository at this point in the history
  • Loading branch information
romainfrancois committed Sep 10, 2014
1 parent ead41b4 commit 03728e7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
6 changes: 4 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# dplyr 0.2.0.99

* allow list, i.e. `VECSXP` columns in mutate (#555)
* `rbind_all` now handles list columns (#463).

* `arrange` was losing `tbl_df` class (#563)
* allow list, i.e. `VECSXP` columns in mutate (#555).

* `arrange` was losing `tbl_df` class (#563).

* The db backend system has been completely overhauled in order to make
it possible to add backends in other packages, and to support a much
Expand Down
1 change: 1 addition & 0 deletions inst/include/dplyr/Collecter.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ namespace dplyr {
return new Collecter_Impl<REALSXP>(n) ;
case LGLSXP: return new Collecter_Impl<LGLSXP>(n) ;
case STRSXP: return new Collecter_Impl<STRSXP>(n) ;
case VECSXP: return new Collecter_Impl<VECSXP>(n) ;
default: break ;
}
return 0 ;
Expand Down
2 changes: 1 addition & 1 deletion src/bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ List rbind__impl( Dots dots ){
columns.push_back( coll );
names.push_back(name) ;
}

if( coll->compatible(source) ){
// if the current source is compatible, collect
coll->collect( SlicingIndex( k, nrows), source ) ;
Expand Down
5 changes: 5 additions & 0 deletions tests/testthat/test-rbind.r
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,8 @@ test_that( "Collecter_Impl<INTSXP> can collect LGLSXP. #321", {
expect_equal( res$x, c(1:3, NA) )
})

test_that("rbind_all handles list columns (#463)", {
dfl <- data.frame(x = I(list(1:2, 1:3, 1:4)))
res <- rbind_all(list(dfl, dfl))
expect_equal(rep(dfl$x,2L), res$x)
})

0 comments on commit 03728e7

Please sign in to comment.