I am trying to add the team winning percentage into Teams2015 but am unsure how to do so. The calculation is WinPercent = W/(W+L). How would I add this to the code below?
Teams2015 <- Teams %>%
select(yearID, teamID, name, G, W, L,attendance) %>%
filter(yearID >= 2015) %>%
mutate(teamID = droplevels(teamID)
FJCC
June 2, 2022, 7:09pm
2
Without seeing the data, my guess is that you want code like the following.
Teams2015 <- Teams %>%
select(yearID, teamID, name, G, W, L,attendance) %>%
filter(yearID >= 2015) %>%
mutate(teamID = droplevels(teamID),
Win_Perc = W/(W + L))
1 Like
system
Closed
June 9, 2022, 7:10pm
3
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.