beanumber / openWAR

An R package enabling the computation of openWAR using MLBAM data
99 stars 33 forks source link

Sxslt errors on download #101

Closed znmeb closed 8 years ago

znmeb commented 8 years ago

I'm cranking up openWAR again for 2016. I used

devtools::install_github("cboettig/Sxslt")
devtools::install_github("beanumber/openWAR")
MLBAM <- openWAR::getData(start= "2016-01-01", end = "2016-03-15")

It seems to be working except that it's throwing numerous errors of the form

failed to load HTTP resource
Error in XML::saveXML(Sxslt::xsltApplyStyleSheet(gd$url[i], xsl)$doc) : 
  error in evaluating the argument 'doc' in selecting a method for function 'saveXML': Error: 1: failed to load HTTP resource

gid_2016_02_29_neubbc_bosmlb_2

Is this something in openWAR, cboettig/Sxslt, or is it just some server overloading issue on MLBAM?

gjm112 commented 8 years ago

I don't know if it's openWAR or Sxslt, but our function getData seems to spit back errors for games that aren't regulation in some sense. That look like an exhibition game to me. Is it possible that exhibition games don't get tracked in MLBAM?

znmeb commented 8 years ago

@gjm112 could be - I thinned the dates down to a small subset that mostly failed and the errors were reproducible. So it might be a different format for some games on MLBAM.

znmeb commented 8 years ago

@gjm112 I think I see one issue - some games appear to have two entries in the index. For example, the 2015 American League wild card game on October 6, 2015:

gid_2015_10_06_awcmlb_awcmlb_1
failed to load HTTP resource
Error in XML::saveXML(Sxslt::xsltApplyStyleSheet(gd$url[i], xsl)$doc) : 
  error in evaluating the argument 'doc' in selecting a method for function 'saveXML': Error: 1: failed to load HTTP resource

gid_2015_10_06_houmlb_nyamlb_1

The first one (failed) looks like code for "American wild card" and the second one (succeeded) is the game itself.

beanumber commented 8 years ago

Like Billy Beane, our s*#t doesn't work in the playoffs:

https://github.com/beanumber/openWAR/blob/master/R/getData.R#L50

gjm112 commented 8 years ago

Yet.....

On Tue, May 10, 2016 at 9:04 PM, Ben Baumer notifications@github.com wrote:

Like Billy Beane, our s*#t doesn't work in the playoffs:

https://github.com/beanumber/openWAR/blob/master/R/getData.R#L50

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/beanumber/openWAR/issues/101#issuecomment-218343241

Gregory J. Matthews, Ph.D. Assistant Professor Department of Mathematics and Statistics Loyola University Chicago E-mail: gjm112 -at- gmail.com Blog: StatsInTheWild.com Art: etsy.me/1JAsYz9 Twitter: @StatsInTheWild http://www.twitter.com/StatsInTheWild Twitter: @StatsClass http://www.twitter.com/statsclass

znmeb commented 8 years ago

@glm112 Is the "yet" for Beane or for openWAR? ;-)

gjm112 commented 8 years ago

Both....? :)

On Tue, May 10, 2016 at 11:20 PM, M. Edward (Ed) Borasky < notifications@github.com> wrote:

@glm112 Is the "yet" for Beane or for openWAR? ;-)

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/beanumber/openWAR/issues/101#issuecomment-218357975

Gregory J. Matthews, Ph.D. Assistant Professor Department of Mathematics and Statistics Loyola University Chicago E-mail: gjm112 -at- gmail.com Blog: StatsInTheWild.com Art: etsy.me/1JAsYz9 Twitter: @StatsInTheWild http://www.twitter.com/StatsInTheWild Twitter: @StatsClass http://www.twitter.com/statsclass