BillPetti / baseballr

A package written for R focused on baseball analysis. Currently in development.
billpetti.github.io/baseballr
Other
369 stars 99 forks source link

milb pitcher and batter game logs function not returning % stats #218

Closed yojo98 closed 3 years ago

yojo98 commented 3 years ago

I am trying to get milb data, but for batters using the milb_batter_game_logs_fg function returns a few "NAs introduced by coercion", and the resulting DF/output does not include BB and K%, and similarly with the pitcher function it returns NAs for all rows of BB%, K%, K minus BB %, and LOB%.

BillPetti commented 3 years ago

Can you please include a reproducible example and your session info?

yojo98 commented 3 years ago

Sure! This is the basics of what I'm doing. The resulting takahashi DF is missing the stats I mentioned, and the NAs introduced by coercion error prints 4 times, corresponding to the number of columns that have all NAs. Thanks again for the quick response!

library("baseballr") library("tidyverse")

takahasi <- milb_pitcher_game_logs_fg("sa830370", 2021)

BillPetti commented 3 years ago

Thanks, I’ll take a a look but I also need your session info.

BillPetti commented 3 years ago

Never mind. Thought this was fixed before, but that was for mlb game logs. Reinstall baseballr and you should be good to go.

yojo98 commented 3 years ago

Sorry, here is my session info.

Session info --------------------------------------- setting value
version R version 4.0.0 (2020-04-24) os Windows 10 x64
system x86_64, mingw32
ui RStudio
language (EN)
collate English_United States.1252
ctype English_United States.1252
tz America/New_York
date 2021-08-29

[1] C:/Users/Joe/Documents/R/win-library/4.0 [2] C:/Program Files/R/R-4.0.0/library

Attempting to install baseball using the following command also is now giving me an error.

require(devtools) install_github("BillPetti/baseballr")

the error is as follows

install_github("BillPetti/baseballr") Downloading GitHub repo BillPetti/baseballr@HEAD √ checking for file 'C:\Users\Joe\AppData\Local\Temp\RtmpSGvAf6\remotes2cc06e8164e1\BillPetti-baseballr-d1cc5a0/DESCRIPTION' ...

  • preparing 'baseballr': (710ms) √ checking DESCRIPTION meta-information ...
  • checking for LF line-endings in source and make files and shell scripts
  • checking for empty or unneeded directories
  • building 'baseballr_0.8.6.tar.gz'

Installing package into ‘C:/Users/Joe/Documents/R/win-library/4.0’ (as ‘lib’ is unspecified)

BillPetti commented 3 years ago

Sorry about that, try now.

yojo98 commented 3 years ago

Great, all fixed now! I really appreciate the quick response and the amazing package. Cheers!