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

now i need flatten #12

Open
berndbischl opened this issue Jan 1, 2019 · 4 comments
Open

now i need flatten #12

berndbischl opened this issue Jan 1, 2019 · 4 comments

Comments

@berndbischl
Copy link
Member

i want to peel off exactly one level of a list of list

so this should be
x = list(list(iris[1:2,]), list(iris[1:2,]))

list(iris[1:2,], iris[1:2,])

@berndbischl
Copy link
Member Author

can we actaully copy the C code over (from purrr flatten)?
can we please really talk about what is going to happen in general?

@berndbischl
Copy link
Member Author

@mllg +10 this
more reasons:

a)
unlist(list(named_list()), recursive=F)
list()

b)

unlist(list(foo = list(x = 1)), recursive=F)
$foo.x
[1] 1

i dont necessarily want the code from purrr but i want a reliable operation

@mb706
Copy link
Contributor

mb706 commented Feb 15, 2019

What is wrong with (b)? You want use.names = false?

@berndbischl
Copy link
Member Author

What is wrong with b) is the element name change. Use.name to F does not work that drops all names incl. x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants