I have a data set that contains NBA injury data from 2010 to 2018. The data was presented "by player", and I'm trying to aggregate it. so that it's "by team". I also have injuries by player, and want to convert the injuries to "by team" as well. How would I be able to create this dataset? Thank you for your help!
dput(injuries[1:20,c(2,6)])
structure(list(Team = c("Chicago Bulls", "Detroit Pistons", "Detroit Pistons",
"Portland Trail Blazers", "New Jersey Nets", "Detroit Pistons",
"Detroit Pistons", "Denver Nuggets", "Milwaukee Bucks", "Sacramento Kings",
"Charlotte Bobcats", "Golden State Warriors", "Phoneix Suns",
"Miami Heat", "Oklahoma City Thunder", "Minnesota Timberwolves",
"Miami Heat", "Milwaukee Bucks", "Milwaukee Bucks", "Memphis Grizzlies"
), body_part = c("finger", "achilles", "toe", "knee", "back",
"achilles", "toe", "foot", "hip", "groin", "leg", "finger", "finger",
"hand", "knee", "back", "ankle", "ankle", "ankle", "back")), row.names = c(NA,
-20L), class = c("tbl_df", "tbl", "data.frame"))