Hey all,
I have a dataset with ID's and the types of fitness classes they attended over the course of a year. I was able to aggregate and clean the data but I'm getting stuck on how to create a bunch of columns (for each fitness class) and the frequency of which they attended.
Here's a snip of what my data looks like:
ID Class n
101 spin 50
101 yoga 25
102 spin 50
102 yoga 25
102 bootcamp 20
102 aerobics 10
103 yoga 50
103 aerobics 10
And I'd want it to tranform into:
ID spin yoga bootcamp aerobics
101 50 25 0 0
102 50 25 20 10
103 0 50 0 10
Thank you!