Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework flattening #912

Merged
merged 29 commits into from
Sep 8, 2022
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
078c80e
Implement list_flatten()/_c()/_rbind()/_cbind()
hadley Sep 2, 2022
50c74f3
Deprecate flatten_*
hadley Sep 2, 2022
13cf2c3
Add news bullets
hadley Sep 2, 2022
aeba6bc
Move _dfc() and _dfr() to own file
hadley Sep 2, 2022
87304a7
Polish list_flatten() implementation
hadley Sep 3, 2022
c126644
Update connection to splice
hadley Sep 3, 2022
90ce7e0
Test list_c() and friends
hadley Sep 3, 2022
3a5192f
Move map_at(), _if(), _depth() to own file
hadley Sep 3, 2022
bf27747
Tweak map docs
hadley Sep 4, 2022
96dfd4d
Implement map_c()/map_cbind()/map_rbind()
hadley Sep 4, 2022
7a618c0
Get R CMD check passing again
hadley Sep 4, 2022
af378ad
Fix narrowing of `.f`
hadley Sep 4, 2022
94d7324
Apply suggestions from code review
hadley Sep 8, 2022
d687da0
Remove map wrappers
hadley Sep 8, 2022
1e143d2
Re-document
hadley Sep 8, 2022
0fee03e
Improve error reporting
hadley Sep 8, 2022
b6b939e
list_flatten() improvements
hadley Sep 8, 2022
32ce653
Doc updates
hadley Sep 8, 2022
cf301ae
Test that data frames aren't ok
hadley Sep 8, 2022
3cd7a1a
Merge commit 'c3ad48c251d6909bf4710cee287e5e14c3428aa6'
hadley Sep 8, 2022
e058e71
stringsAsFactors = ugh
hadley Sep 8, 2022
68c72eb
Update news and function reference
hadley Sep 8, 2022
a209d5c
Tweak docs
hadley Sep 8, 2022
10077a4
Doc tweak
hadley Sep 8, 2022
91a76f0
Update/finish deprecation messages
hadley Sep 8, 2022
eb288c9
Use map_if instead of modify_if
hadley Sep 8, 2022
c71fcc8
Require data frames
hadley Sep 8, 2022
dc8ca02
Doc fixes
hadley Sep 8, 2022
5206ecd
Merge commit 'd2896e2a2951f40f6b87f2a530eb4ee2dda0b38f'
hadley Sep 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Test that data frames aren't ok
hadley committed Sep 8, 2022
commit cf301aedc8e1c115bd0e1cb88eb0bf8da037ff54
18 changes: 18 additions & 0 deletions tests/testthat/_snaps/list-combine.md
Original file line number Diff line number Diff line change
@@ -64,3 +64,21 @@
Error in `list_cbind()`:
! `x` must be a list, not a number.

---

Code
list_c(mtcars)
Condition
Error in `list_c()`:
! `x` must be a list, not a <data.frame> object.
Code
list_rbind(mtcars)
Condition
Error in `list_rbind()`:
! `x` must be a list, not a <data.frame> object.
Code
list_cbind(mtcars)
Condition
Error in `list_cbind()`:
! `x` must be a list, not a <data.frame> object.

7 changes: 7 additions & 0 deletions tests/testthat/test-list-combine.R
Original file line number Diff line number Diff line change
@@ -56,4 +56,11 @@ test_that("assert input is a list", {
list_rbind(1)
list_cbind(1)
hadley marked this conversation as resolved.
Show resolved Hide resolved
})

# and not just built on a list
expect_snapshot(error = TRUE, {
list_c(mtcars)
list_rbind(mtcars)
list_cbind(mtcars)
})
})