Closed momeara closed 9 years ago
What would you expect this to do?
data_frame(
a = c("a:b", "c"),
b = c("1:2:3", "3"),
c = c(11,22)
) %>%
transform(
a = strsplit(a,":"),
b = strsplit(b,":")
)
%>%
unnest(a, b)
Either giving an error or filling in with NA
values like this:
a b c
a 1 11
b 2 11
NA 3 11
c 3 22
I'd like
unnest
to support unnesting multiple columns at once. For example,would produce
As a real world example where this comes up, the HGNC allows extracting gene family ids and descriptions, but it organizes them like this:
I'd like it unnest
hgnc_gene_family_ids
andhgnc_gene_family_descriptions
simultaneously:as a preliminary implementation, I have this
If this looks like something that would be generally useful, I'd be happy to make a pull request that fits it into the package.