cpsievert / pitchRx

Tools for scraping MLB Gameday data and Visualizing PITCHf/x
http://cpsievert.github.io/pitchRx/
Other
124 stars 33 forks source link

Is "update_db" working? #39

Closed znmeb closed 8 years ago

znmeb commented 8 years ago

I downloaded a complete database starting at 2015-03-01 and saved it to an SQLite database on 2016-03-28. Now when I run

> db <- dplyr::src_sqlite("~/ISOs/mlb.sqlite")
> pitchRx::update_db(connect = db$con)

I get

Already up to date
NULL

'scrape' sees the new game IDs, so I'm not sure what's happening here.

edk1124 commented 8 years ago

When I try doing update_db on my sqlite3, I get:

Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘dbExistsTable’ for signature ‘"src_sqlite", "character"’

Could be a different issue though. Any ideas?

znmeb commented 8 years ago

@edk1124 @cpsievert I'm planning to fork the project and run it under the RStudio debugger tomorrow to see what's happening. If it's something easy I'll put in a pull request.

znmeb commented 8 years ago

@cpsievert I think I see what's happening. The entire PITCHF/x database goes back to 2008, but I only want data starting at 2015. So when I did my initial scrape I started with 2015. Then I ran update_db and it looks like it got confused because the games I have already are in the middle of the games it knows about.

So I'm going to try this with the full database starting in 2008 to see what happens. I can always limit what I look at in queries ;-).

evbettor commented 8 years ago

I am having the same issue of the:


> pitchRx::update_db(db$con)
Already up to date
NULL
> max(pa_full$date)
[1] "2016_04_04"
> Sys.Date()
[1] "2016-04-16"`

Did you have any luck updating @znmeb ?

znmeb commented 8 years ago

Pull request is just above your post, @evbettor