diff --git a/NEWS.md b/NEWS.md index 7b25f3a1b9..3a6848b4c6 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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 diff --git a/inst/include/dplyr/Collecter.h b/inst/include/dplyr/Collecter.h index 31e3fddd91..2d0488ee34 100644 --- a/inst/include/dplyr/Collecter.h +++ b/inst/include/dplyr/Collecter.h @@ -332,6 +332,7 @@ namespace dplyr { return new Collecter_Impl(n) ; case LGLSXP: return new Collecter_Impl(n) ; case STRSXP: return new Collecter_Impl(n) ; + case VECSXP: return new Collecter_Impl(n) ; default: break ; } return 0 ; diff --git a/src/bind.cpp b/src/bind.cpp index a77019ae9a..32c29c7af7 100644 --- a/src/bind.cpp +++ b/src/bind.cpp @@ -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 ) ; diff --git a/tests/testthat/test-rbind.r b/tests/testthat/test-rbind.r index 1100a165de..fdfdf018e7 100644 --- a/tests/testthat/test-rbind.r +++ b/tests/testthat/test-rbind.r @@ -123,3 +123,8 @@ test_that( "Collecter_Impl 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) +})