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

most_recent_season functions error #287

Closed saiemgilani closed 1 year ago

saiemgilani commented 1 year ago

From @Only-Slightly-Bent (Only-Slightly-Bent) with much appreciated PR (which I will close since I addressed it on the development branch before reading yours):

Looks like in the most recent version of R there is an error in the most_recent_mlb_season() function. It throws the following error: Error in substr(Sys.Date(), 1, 4) - 1 : non-numeric argument to binary operator.

Moving the parenthesis fixes it so that you cast the string as a double before subtracting instead.