Coder Social home page Coder Social logo

Issue with FG Leaders Pull about baseballr HOT 5 CLOSED

billpetti avatar billpetti commented on July 17, 2024
Issue with FG Leaders Pull

from baseballr.

Comments (5)

keberwein avatar keberwein commented on July 17, 2024

@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!

from baseballr.

BillPetti avatar BillPetti commented on July 17, 2024

@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

from baseballr.

BillPetti avatar BillPetti commented on July 17, 2024

@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.

from baseballr.

jestarr avatar jestarr commented on July 17, 2024

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

from baseballr.

BillPetti avatar BillPetti commented on July 17, 2024

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.

from baseballr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.