I have used pivot_longer to transform my dataset as
name value
<chr> <dbl>
1 A 3
2 B 2
3 C 3
4 A 2
5 B 2
6 C 3
I want to count value
of each name
as
value A B C
1 0 0 0
2 1 2 0
3 1 0 2
I wonder how to use dplyr
to ahieve it.