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

Nest() and unnest() operators #3

Closed
hadley opened this issue Jun 11, 2014 · 6 comments
Closed

Nest() and unnest() operators #3

hadley opened this issue Jun 11, 2014 · 6 comments

Comments

@hadley
Copy link
Member

@hadley hadley commented Jun 11, 2014

Would converted repeated values in to a list-column, and vice versa. Would be useful primitive when working with values like (1, 2, 3)

@hadley
Copy link
Member Author

@hadley hadley commented Jul 28, 2014

From tidyverse/dplyr#342

products <- strsplit(leads$Combo_Product_Interest__c, ";")
products[vapply(products, function(x) all(is.na(x)), logical(1))] <- list(NULL)

n <- vapply(products, length, numeric(1))

interest <- data.frame(
  Id = leads$Id[rep(1:nrow(leads), n)], 
  Product = unlist(products),
  stringsAsFactors = FALSE
)
@hadley
Copy link
Member Author

@hadley hadley commented Aug 4, 2014

Should also work with data frames?

@hadley
Copy link
Member Author

@hadley hadley commented Aug 22, 2014

And maybe named lists of data frames?

hadley added a commit that referenced this issue Aug 22, 2014
Closes #22. #3
@andrewheiss
Copy link

@andrewheiss andrewheiss commented Nov 10, 2014

This is a fantastic function and a perfect addition to tidyr. Please consider keeping it in (I'm slightly concerned about the "experimental" label…)

@hadley
Copy link
Member Author

@hadley hadley commented May 18, 2015

@andrewheiss it's mostly the unnest method for lists that's experimental. unnest() is here to stay.

@andrewheiss
Copy link

@andrewheiss andrewheiss commented May 18, 2015

Oh good :)

@hadley hadley closed this in a312b26 May 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants