moodymudskipper / tb

IN ~PROGRESS my own take on `[.data.frame`
0 stars 0 forks source link

multi spread with multiple functions #37

Open moodymudskipper opened 4 years ago

moodymudskipper commented 4 years ago

These should do the same :

df <- data.frame(id = rep(1:4, rep(2,4)),
                 visit = I(rep(c("Before","After"), 4)),
                 x = rnorm(4), y = runif(4))

df %tb>% .[`x.<visit>` = x, `y.<visit>` = y, .by = id]
df %tb>% .[`<values_from>.<visit>` = list(x, y)]