id = c(1,2,3,4)
desc = c("A", "B", "B", "A")
df = data.frame(id, desc)
> df
id descr
1 A
2 B
3 B
4 A
How can I reshape the df to look like:
A B
1 2
4 3
I've tried dcast, table, etc.
both are character variable. I basically want to go from long to wide but idk what syntax to use