Watts-College / paf-513-fall-2023

0 stars 0 forks source link

Lab 6: Step 3 #16

Open kdelaro2 opened 11 months ago

kdelaro2 commented 11 months ago

Hi Professor,

I keep receiving the following error on Step 3:

Error in mutate(., cost.per.win = (team.budget/W/100000)) : Caused by error: ! object 'team.budget' not found

This is the code I have: dat1 %>% mutate(cost.per.win = ( team.budget/W/100000)) %>% arrange(desc(cost.per.win)) %>% pander()

Thank you for your help!

drcarlson-asu commented 11 months ago

Hello, It looks like 'team.budget' is the problem here. Take a look at this resource to help you troubleshoot what's happening: https://www.statology.org/r-object-not-found/ ~Dr. C

kdelaro2 commented 11 months ago

Thank you professor!

I'm now getting an error that object W doesn't exist, but when I run exists(team.salaries$W) it shows that it does? Would I need to define W again?

`team.salaries %>% group_by(yearID, teamID) %>% summarize(total.players = n(), team.budget = sum(salary.adj))

mutate(cost.per.win = ( team.budget/W/100000)) %>% arrange(cost.per.win) %>% head(25) %>% pander()`