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

Comments

Projects
None yet
2 participants
@hadley
Member

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

This comment has been minimized.

Member

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

This comment has been minimized.

Member

hadley commented Aug 4, 2014

Should also work with data frames?

@hadley

This comment has been minimized.

Member

hadley commented Aug 22, 2014

And maybe named lists of data frames?

hadley added a commit that referenced this issue Aug 22, 2014

@andrewheiss

This comment has been minimized.

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

This comment has been minimized.

Member

hadley commented May 18, 2015

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

@andrewheiss

This comment has been minimized.

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