I have the following tibble data frame in R
tribble(
~x, ~y, ~z,
"a", "A1", 3.6,
"b", "A2", 8.5,
"c", "A1", 4.6,
"d", "A2", 6.5,
"e", "A1", 1.6,
"f", "A2", 9.5
)
# A tibble: 6 x 3
x y z
<chr> <chr> <dbl>
1 a A1 3.6
2 b A2 8.5
3 c A1 4.6
4 d A2 6.5
5 e A1 1.6
6 f A2 9.5
Is there a way to bring the tibble into the following form
a b c d e f
A1 3.6 4.6 1.6 8.5 6.5 9.5
A2 3.6 4.6 1.6 8.5 6.5 9.5