Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with FG Leaders Pull #28

Closed
jestarr opened this issue May 16, 2017 · 5 comments
Closed

Issue with FG Leaders Pull #28

jestarr opened this issue May 16, 2017 · 5 comments

Comments

@jestarr
Copy link

jestarr commented May 16, 2017

I tried running this data pull:
head(fg_bat_leaders(x = 2015, y = 2016, league = "all", qual = "y", ind = 0)) %>%

  • select(Seasons:AVG)
    

I got the error below:
Error in select_(.data, .dots = lazyeval::lazy_dots(...)) :
object 'Seasons' not found
In addition: Warning messages:
1: NAs introduced by coercion
2: NAs introduced by coercion

@keberwein
Copy link
Contributor

@BillPetti These warnings are not usually a problem BUT, in this case, some of the numbers in the Dol column are surrounded by (). I guess that mean rounded? Anyway, those are coerced to NA, which isn't good. I've got time to work on this tomorrow. A little gsub magic should do the trick!

@BillPetti
Copy link
Owner

@jestarr I've tried replicating your error, but can't seem to do it. Have you tried reinstalling?

>head(baseballr::fg_bat_leaders(x = 2015, y = 2016, league = "all", qual = "y", ind = 0)) %>% select(Seasons:AVG)

    Seasons #             Name         Team Age   G   AB   PA   H  1B 2B 3B HR
1 2015-2016 1       Joey Votto         Reds  32 316 1101 1372 352 223 67  4 58
2 2015-2016 2       Mike Trout       Angels  24 318 1124 1363 345 200 64 11 70
3 2015-2016 3   Miguel Cabrera       Tigers  32 277 1024 1190 333 216 59  2 56
4 2015-2016 4     Bryce Harper    Nationals  22 300 1027 1281 295 164 62  3 66
5 2015-2016 5   Josh Donaldson    Blue Jays  30 313 1197 1411 348 190 73  7 78
6 2015-2016 6 Paul Goldschmidt Diamondbacks  28 317 1146 1400 354 221 71  5 57
    R RBI  BB IBB  SO HBP SF SH GDP SB CS   AVG
1 196 177 251  30 255  10 10  0  27 19  4 0.320
2 227 190 208  26 295  21 10  0  16 41 14 0.307
3 156 184 152  30 198   7  7  0  45  1  1 0.325
4 202 185 232  35 248   8 14  0  26 27 14 0.287
5 244 222 182   6 252  15 13  4  32 13  1 0.291
6 209 205 228  44 301   9 15  0  30 53 10 0.309
Warning messages:
1: In baseballr::fg_bat_leaders(x = 2015, y = 2016, league = "all",  :
  NAs introduced by coercion
2: In baseballr::fg_bat_leaders(x = 2015, y = 2016, league = "all",  :
  NAs introduced by coercion

@BillPetti
Copy link
Owner

@keberwein Ah, yes I missed that. Dol refers to the dollarized value of the players WAR. The way the results display on fangraphs is that negative value is enclosed in parentheses--so, accounting formatting. I just pushed a fix, let me know if that does it.

@jestarr
Copy link
Author

jestarr commented May 26, 2017

I tried re-installing and I'm now getting this error:
Error in select(., Seasons:AVG) : could not find function "select"
In addition: Warning message:
In baseballr::fg_bat_leaders(x = 2015, y = 2016, league = "all", :
NAs introduced by coercion

@BillPetti
Copy link
Owner

Are you loading dplyr separately in your global environment? The error is not occurring when you use the fg_bat_leaders function, but after you've pulled down the data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants