@@ -8,7 +8,7 @@ if (exists("test.data.table", .GlobalEnv, inherits=FALSE)) {
88 test = data.table:::test
99}
1010
11- # cbindlist
11+ # cbindlist, setcbindlist
1212
1313local({
1414 l = list(
@@ -20,7 +20,7 @@ local({
2020 expected = data.table(l$d1, l$d2, l$d3)
2121 test(11.01, ans, expected)
2222 test(11.02, intersect(vapply(ans, address, ""), unlist(lapply(l, vapply, address, ""))), character())
23- ans = cbindlist(l, copy=FALSE )
23+ ans = setcbindlist(l )
2424 expected = setDT(c(l$d1, l$d2, l$d3))
2525 test(11.03, ans, expected)
2626 test(11.04, length(intersect(vapply(ans, address, ""), unlist(lapply(l, vapply, address, "")))), ncol(expected))
@@ -49,8 +49,8 @@ test(12.12, cbind(data.table(x=integer()), data.table(a=1:2)), data.table(x=c(NA
4949test(12.13, cbind(data.table(x=1L), data.table(a=1:2)), data.table(x=c(1L, 1L), a=1:2))
5050test(12.14, cbindlist(list(data.table(a=integer()), data.table(b=1:2))), error="Recycling.*not yet implemented")
5151test(12.15, cbindlist(list(data.table(a=1L), data.table(b=1:2))), error="Recycling.*not yet implemented")
52- test(12.16, cbindlist (list(data.table(a=integer()), data.table(b=1:2)), copy=FALSE ), error="have to have the same number of rows")
53- test(12.17, cbindlist (list(data.table(a=1L), data.table(b=1:2)), copy=FALSE ), error="have to have the same number of rows")
52+ test(12.16, setcbindlist (list(data.table(a=integer()), data.table(b=1:2))), error="have to have the same number of rows")
53+ test(12.17, setcbindlist (list(data.table(a=1L), data.table(b=1:2))), error="have to have the same number of rows")
5454
5555## retain indices
5656local({
@@ -63,9 +63,9 @@ local({
6363 setkeyv(l[[1L]], "id1"); setindexv(l[[1L]], list("id1", "id2", "id3", c("id1","id2","id3"))); setindexv(l[[3L]], list("id6", "id7")); setindexv(l[[4L]], "id9")
6464 ii = lapply(l, indices)
6565 ans = cbindlist(l)
66- test(13.04 , key(ans), "id1")
67- test(13.05 , indices(ans), c("id1", "id2", "id3", "id1__id2__id3", "id6", "id7", "id9"))
68- test(13.06 , ii, lapply(l, indices)) ## this tests that original indices have not been touched, shallow_duplicate in mergeIndexAttrib
66+ test(13.01 , key(ans), "id1")
67+ test(13.02 , indices(ans), c("id1", "id2", "id3", "id1__id2__id3", "id6", "id7", "id9"))
68+ test(13.03 , ii, lapply(l, indices)) ## this tests that original indices have not been touched, shallow_duplicate in mergeIndexAttrib
6969})
70- test(13.07 , cbindlist(list(data.table(a=1:2), data.table(b=3:4, key="b"))), data.table(a=1:2, b=3:4, key="b"))
71- # test(13.08 , cbindlist(list(data.table(a=1:2, key="a"), data.table(b=3:4, key="b"))), data.table(a=1:2, b=3:4, key=c("a", "b")))
70+ test(13.04 , cbindlist(list(data.table(a=1:2), data.table(b=3:4, key="b"))), data.table(a=1:2, b=3:4, key="b"))
71+ # test(13.05 , cbindlist(list(data.table(a=1:2, key="a"), data.table(b=3:4, key="b"))), data.table(a=1:2, b=3:4, key=c("a", "b")))
0 commit comments