meysubb / cfbscrapR-archived

CFB R Package
GNU General Public License v3.0
25 stars 9 forks source link

ReadBin error when trying to import data #55

Closed mcemerden closed 4 years ago

mcemerden commented 4 years ago

I'm using this code to get pbp data.

cpbp <- data.frame()

for (j in 2012:2019){
  data <- data.frame()
  for(i in 1:15) {
    data2 <-
      cfb_pbp_data(year = j, season_type = "both", week = i, epa_wpa = FALSE) %>%
      mutate(week = i, year = j)
    data2 <- data.frame(data2)
    data <- bind_rows(data, data2)
  }
  cpbp <- bind_rows(cpbp, data)
}

However I'm getting this error:

Error in readBin(3L, raw(0), 32768L) : transfer closed with 10396534 bytes remaining to read

I had no problem getting the data previously and have re-installed the package to no avail. Thanks R Version 3.6.2

spfleming commented 4 years ago

Have you replicated the error with a smaller time frame? This is a large data pull; you may be running out of space. Try to pull fewer years at a time!

mcemerden commented 4 years ago

Yes I tried it with only a single season but got the same error. The i/js don't even go through a single iteration

spfleming commented 4 years ago

The week iteration is an unnecessary step, so this is probably a code error, not a package error. Can you try to run it with data2 being defined as:

data2 <- cfb_pbp_data(year = j, season_type = "both", week = NULL, epa_wpa = FALSE)

mcemerden commented 4 years ago

I realized some instability with my connection and trying my hotspot worked for now. I'll trying again when my connection is fixed and will close