Closed moodymudskipper closed 4 years ago
once we've switched to <> for spread/gather
<>
For some more complex cases we might use unglue, not all though.
library(dplyr) df <- data.frame(x = c(NA, "a.b", "a.d", "b.c")) df %>% separate(x, c("A", "B")) df %tb>% .[`{A}.{B}` = x] # If you just want the second variable: df %>% separate(x, c(NA, "B")) df %tb>% .[`{=.*?}.{B}` = x] df %tb>% .[`{}.{B}` = x]
this df %tb>% .[{A}.{B}= x] would really be df %tb>% .[+unglue_data(x, "{A}.{B}"] so not sure if we need something new
df %tb>% .[
= x]
df %tb>% .[+unglue_data(x, "{A}.{B}"]
once we've switched to
<>
for spread/gatherFor some more complex cases we might use unglue, not all though.