testData <- data.frame("player" = c(1,2,1,2,2,3,3,2,3,1),
"event" = c(rep("shot",3),rep("pass",5),rep("score",2)))
testData
# player event
#1 1 shot
#2 2 shot
#3 1 shot
#4 2 pass
#5 2 pass
#6 3 pass
#7 3 pass
#8 2 pass
#9 3 score
#10 1 score
desiredResult
# player shots passes scores
#1 1 2 0 1
#2 2 1 3 0
#3 3 0 2 1
Asked
Active
Viewed 12 times
1

Ronak Shah
- 377,200
- 20
- 156
- 213

Daniel LeZotte
- 11
- 1
-
`table(testData)` or `table(testData$player, testData$event)` if you have other columns – Ronak Shah May 22 '18 at 01:28