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 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 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 commented Aug 4, 2014

Should also work with data frames?

@hadley
Copy link
Member Author

hadley commented Aug 22, 2014

And maybe named lists of data frames?

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

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 commented May 18, 2015

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

@andrewheiss
Copy link

Oh good :)

@hadley hadley closed this as completed in a312b26 May 18, 2015
hadley pushed a commit that referenced this issue Nov 1, 2023
Fixes #1475. The `separate_wider_position()` and `separate_wider_regex()` functions provide the `too_few` argument to control their behavior when one or more of the strings cannot be separated into as many pieces as the user specifies. When this happens, the error message that is displayed recommends specifying too_few as "start", rather than the valid value "align_start".
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