{"action":"created","issue":{"url":"https://api.github.com/repos/beanumber/openWAR/issues/32","labels_url":"https://api.github.com/repos/beanumber/openWAR/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/beanumber/openWAR/issues/32/comments","events_url":"https://api.github.com/repos/beanumber/openWAR/issues/32/events","html_url":"https://github.com/beanumber/openWAR/issues/32","id":78513865,"number":32,"title":"makeWAR fails with makeWARBaserunning error","user":{"login":"davidbmitchell","id":11139738,"avatar_url":"https://avatars.githubusercontent.com/u/11139738?v=3","gravatar_id":"","url":"https://api.github.com/users/davidbmitchell","html_url":"https://github.com/davidbmitchell","followers_url":"https://api.github.com/users/davidbmitchell/followers","following_url":"https://api.github.com/users/davidbmitchell/following{/other_user}","gists_url":"https://api.github.com/users/davidbmitchell/gists{/gist_id}","starred_url":"https://api.github.com/users/davidbmitchell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidbmitchell/subscriptions","organizations_url":"https://api.github.com/users/davidbmitchell/orgs","repos_url":"https://api.github.com/users/davidbmitchell/repos","events_url":"https://api.github.com/users/davidbmitchell/events{/privacy}","received_events_url":"https://api.github.com/users/davidbmitchell/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-20T12:54:13Z","updated_at":"2015-05-20T19:28:39Z","closed_at":null,"body":"The actual error pops up after the \"...Estimating Baserunning Runs Above Average...\" message. The error says: \r\n\r\nError in makeWARBaserunning(data[br.idx, br.fields], models[[\"baserunning\"]],  : \r\n  could not find function \"rename\"\r\n\r\nIs this a dplyr error?\r\n\r\nI attached the package reshape to see if this resolved the error, and it at least changed it to something different. After attaching reshape the new error is:\r\n\r\nError in rename(data, cdf.br3 = cdf.lag) : \r\n  unused argument (cdf.br3 = cdf.lag)\r\n\r\nAny ideas as to what's going on? I'm stumped.\r\n"},"comment":{"url":"https://api.github.com/repos/beanumber/openWAR/issues/comments/104006296","html_url":"https://github.com/beanumber/openWAR/issues/32#issuecomment-104006296","issue_url":"https://api.github.com/repos/beanumber/openWAR/issues/32","id":104006296,"user":{"login":"davidbmitchell","id":11139738,"avatar_url":"https://avatars.githubusercontent.com/u/11139738?v=3","gravatar_id":"","url":"https://api.github.com/users/davidbmitchell","html_url":"https://github.com/davidbmitchell","followers_url":"https://api.github.com/users/davidbmitchell/followers","following_url":"https://api.github.com/users/davidbmitchell/following{/other_user}","gists_url":"https://api.github.com/users/davidbmitchell/gists{/gist_id}","starred_url":"https://api.github.com/users/davidbmitchell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidbmitchell/subscriptions","organizations_url":"https://api.github.com/users/davidbmitchell/orgs","repos_url":"https://api.github.com/users/davidbmitchell/repos","events_url":"https://api.github.com/users/davidbmitchell/events{/privacy}","received_events_url":"https://api.github.com/users/davidbmitchell/received_events","type":"User","site_admin":false},"created_at":"2015-05-20T19:28:39Z","updated_at":"2015-05-20T19:28:39Z","body":"I started by downloading the data from opening day to yesterday\r\n```r\r\nMLBAM2015 <- getData(start = \"2015-04-05\", end = \"2015-05-18\")\r\n```\r\nThen I used the makeWAR function, and it failed.\r\n```r\r\nds <- makeWAR(MLBAM2015)\r\n```\r\nHere is what was outputted in the R console:\r\n```\r\n....Supplied Run Expectancy model does not have a predict method...\r\n....Building in-sample Run Expectancy Model...\r\n....Run Expectancy Model....\r\n          [,1]      [,2]       [,3]\r\n[1,] 0.4691054 0.2366653 0.09334851\r\n[2,] 0.8721534 0.5006906 0.21412448\r\n[3,] 1.0637255 0.6620370 0.30814815\r\n[4,] 1.4474960 0.9262062 0.40732436\r\n[5,] 1.3170732 1.0588235 0.34744268\r\n[6,] 1.7251185 1.0905350 0.45118343\r\n[7,] 2.0089286 1.4027778 0.60289855\r\n[8,] 2.3354037 1.6796875 0.70334928\r\n...Estimating Expected Runs...\r\n...Estimating Fielding Runs Above Average...\r\n....Computing the collective fielding model...\r\n....Applying the collective fielding model...\r\n....Building a fielding model for each position...\r\n...Estimating Pitching Runs Above Average...\r\n....Supplied Pitching model does not have a predict method...\r\n....Building in-sample Pitching Model...\r\n....Pitching Model....\r\nthrows == standTRUE factor(venueId)2681 factor(venueId)3289 \r\n      -0.0199017295       -0.0026960631       -0.0021841327 \r\n  factor(venueId)17 factor(venueId)2395    factor(venueId)4 \r\n      -0.0019121695       -0.0004502747        0.0024157294 \r\n  factor(venueId)12 factor(venueId)4169  factor(venueId)680 \r\n       0.0044209655        0.0050881782        0.0052022300 \r\n  factor(venueId)31 factor(venueId)2889 factor(venueId)2392 \r\n       0.0060761569        0.0081142925        0.0098295971 \r\nfactor(venueId)3309 factor(venueId)3313 factor(venueId)2394 \r\n       0.0106714067        0.0107543637        0.0111193674 \r\n  factor(venueId)22         (Intercept)    factor(venueId)7 \r\n       0.0155778388        0.0176643386        0.0186832599 \r\n  factor(venueId)10 factor(venueId)2602 factor(venueId)3312 \r\n       0.0222903634        0.0277007645        0.0278275434 \r\n  factor(venueId)13   factor(venueId)32   factor(venueId)14 \r\n       0.0285145157        0.0286174208        0.0293689025 \r\n   factor(venueId)3    factor(venueId)5   factor(venueId)15 \r\n       0.0302487815        0.0304835433        0.0310681847 \r\n  factor(venueId)16 factor(venueId)2680   factor(venueId)19 \r\n       0.0330321659        0.0340171190        0.0350345010 \r\n   factor(venueId)2 \r\n       0.0391982688 \r\n...Building model for offense...\r\n....Supplied Offense model does not have a predict method...\r\n....Building in-sample Offense Model...\r\n....Offense Model....\r\nthrows == standTRUE factor(venueId)2395         (Intercept) \r\n      -1.843072e-02       -9.573987e-03       -7.992864e-03 \r\nfactor(venueId)3289 factor(venueId)2681   factor(venueId)17 \r\n      -6.304686e-04       -4.887366e-04       -6.388367e-08 \r\n factor(venueId)680    factor(venueId)4   factor(venueId)12 \r\n       3.921831e-04        3.284146e-03        3.657630e-03 \r\nfactor(venueId)2392 factor(venueId)4169 factor(venueId)2889 \r\n       6.025587e-03        6.280840e-03        9.299921e-03 \r\nfactor(venueId)3309 factor(venueId)3313   factor(venueId)31 \r\n       1.141474e-02        1.152014e-02        1.509783e-02 \r\n   factor(venueId)7 factor(venueId)2394   factor(venueId)22 \r\n       1.606104e-02        1.702189e-02        1.763126e-02 \r\nfactor(venueId)2602   factor(venueId)13   factor(venueId)10 \r\n       2.181765e-02        2.529088e-02        2.764772e-02 \r\n   factor(venueId)3 factor(venueId)2680   factor(venueId)32 \r\n       3.072893e-02        3.338234e-02        3.371365e-02 \r\nfactor(venueId)3312   factor(venueId)14   factor(venueId)15 \r\n       3.461214e-02        3.501403e-02        3.674157e-02 \r\n  factor(venueId)16   factor(venueId)19    factor(venueId)5 \r\n       3.852667e-02        4.105100e-02        4.251139e-02 \r\n   factor(venueId)2 \r\n       4.655416e-02 \r\n...Partitioning Offense into Batting and Baserunning...\r\n....Supplied Baserunning model does not have a predict method...\r\n....Building in-sample Baserunning Model...\r\n....Baserunning Model....\r\n.... 651 coefficients -- suppressing output...\r\n...Estimating Batting Runs Above Average...\r\n....Supplied Batting model does not have a predict method...\r\n....Building in-sample Batting Model...\r\n....Batting Model....\r\n as.factor(batterPos)P as.factor(batterPos)UN as.factor(batterPos)SS \r\n           -0.18687033            -0.05827347            -0.04163385 \r\n as.factor(batterPos)C as.factor(batterPos)2B as.factor(batterPos)LF \r\n           -0.04157799            -0.02892223            -0.02475915 \r\nas.factor(batterPos)DH as.factor(batterPos)CF as.factor(batterPos)3B \r\n           -0.01904690            -0.01845797            -0.01709158 \r\nas.factor(batterPos)RF            (Intercept) \r\n           -0.01144537             0.02956195 \r\n...Estimating Baserunning Runs Above Average...\r\nError in makeWARBaserunning(data[br.idx, br.fields], models[[\"baserunning\"]],  : \r\n  could not find function \"rename\"\r\nIn addition: Warning messages:\r\n1: glm.fit: fitted probabilities numerically 0 or 1 occurred \r\n2: glm.fit: fitted probabilities numerically 0 or 1 occurred \r\n3: glm.fit: fitted probabilities numerically 0 or 1 occurred \r\n4: glm.fit: fitted probabilities numerically 0 or 1 occurred \r\n5: glm.fit: fitted probabilities numerically 0 or 1 occurred \r\n6: glm.fit: fitted probabilities numerically 0 or 1 occurred \r\n7: glm.fit: fitted probabilities numerically 0 or 1 occurred \r\n8: glm.fit: fitted probabilities numerically 0 or 1 occurred \r\n9: glm.fit: fitted probabilities numerically 0 or 1 occurred \r\n10: In predict.lm(mod.br, newdata = data[br.idx, c(\"event\", \"startCode\",  :\r\n  prediction from a rank-deficient fit may be misleading\r\n```\r\n"}}