mkearney / kaggler

🏁 API client for Kaggle
https://github.com/mkearney/kaggler
Other
59 stars 14 forks source link

download data issue #6

Open spirosparaskevas opened 5 years ago

spirosparaskevas commented 5 years ago

library(kaggler)

kgl_auth(username = "spirosparaskevas", key = "5c4359b2493e0d4c73fef611273f09e8")

KAGGLE_USERNAME={"spirosparaskevas"} KAGGLE_KEY={"****"}

comps <- kgl_competitions_list(search = "kkbox") comps

c1_datalist <- kgl_competitions_data_list(comps$id[2]) c1_datalist c1_data <- kgl_competitions_data_download(id = comps$id[2], fileName = c1_datalist$name[1])

final command gives an error: ->

Error in if (is.character(txt) && length(txt) == 1 && nchar(txt, type = "bytes") < : missing value where TRUE/FALSE needed

Any suggestion???

moldach commented 5 years ago

Similar problem for me:

library(tidyverse)
library(kaggler)

comps1 <- kgl_competitions_list() 
c1_datalist <- kgl_competitions_data_list(comps1$id[1])
c1_data <- kgl_competitions_data_download(
  comps1$id[1], c1_datalist$name[1])

Error: lexical error: invalid char in json text. label,pixel0,pixel1,pixel2,pixe (right here) ------^

Here's my sessionInfo():

R version 3.5.3 (2019-03-11)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)

Matrix products: default

locale:
[1] LC_COLLATE=English_Canada.1252  LC_CTYPE=English_Canada.1252    LC_MONETARY=English_Canada.1252
[4] LC_NUMERIC=C                    LC_TIME=English_Canada.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] kaggler_0.0.0.9000 forcats_0.4.0      stringr_1.4.0      dplyr_0.8.3        purrr_0.3.2       
 [6] readr_1.3.1        tidyr_0.8.3        tibble_2.1.3       ggplot2_3.2.1      tidyverse_1.2.1   

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.2       cellranger_1.1.0 pillar_1.4.2     compiler_3.5.3   tools_3.5.3      zeallot_0.1.0   
 [7] packrat_0.5.0    jsonlite_1.6     lubridate_1.7.4  gtable_0.3.0     nlme_3.1-137     lattice_0.20-38 
[13] pkgconfig_2.0.2  rlang_0.4.0      cli_1.1.0        rstudioapi_0.10  curl_4.1         haven_2.1.0     
[19] withr_2.1.2      xml2_1.2.2       httr_1.4.1       generics_0.0.2   vctrs_0.2.0      hms_0.5.1       
[25] grid_3.5.3       tidyselect_0.2.5 glue_1.3.1       R6_2.4.0         readxl_1.3.1     modelr_0.1.4    
[31] magrittr_1.5     backports_1.1.4  scales_1.0.0     rvest_0.3.3      assertthat_0.2.1 colorspace_1.4-1
[37] stringi_1.4.3    lazyeval_0.2.2   munsell_0.5.0    broom_0.5.2      crayon_1.3.4   
tylerburleigh commented 5 years ago

Also getting this problem upon running kgl_competitions_data_download(16531, 'test.csv')

krinya commented 4 years ago

Also getting the same error message:

calendar <- kgl_competitions_data_download(comID, "sell_prices.csv") Error: lexical error: invalid char in json text. PK- (right here) ------^

TimoTheus27 commented 4 years ago

same here

jrosell commented 2 years ago

Same here. I end up writing my own function:

https://gist.github.com/jrosell/9ca888e13f55d1101101adb7fbe8dd3a