IQSS / dataverse-client-r

R Client for Dataverse Repositories
https://iqss.github.io/dataverse-client-r
60 stars 24 forks source link

Progress bar #108

Closed msgoussi closed 2 years ago

msgoussi commented 2 years ago
library("dataverse")

get_dataframe_by_name(
    filename =  "country_partner_hsproduct2digit_year.csv", 
    dataset = "doi:10.7910/DVN/T4CHWJ", # https://doi.org/10.7910/DVN/T4CHWJ
    original = TRUE,
   .f = function(x) read.delim(x, sep = ","),
   server = "dataverse.harvard.edu"
)

it is taking to much time since the file is almost 1GB, so is it possible to include a progress bar / winProgressBar inside get_dataframe_by_name

kuriwaki commented 2 years ago

Good idea, I'll try to put this in 0.3.10 ^

kuriwaki commented 2 years ago

@msgoussi I implemented the suggestion in #109. Let me know if you have any thoughts on the defaults (currently to FALSE, change with progress = TRUE) and the type of progress bar used (currently the built-in progress bar in httr::GET). I'll keep the issue open until tryin to submit v0.3.10 to CRAN in January.

kuriwaki commented 2 years ago

5b1aa0d now sets the default value of progress to NULL. If the default, the command will check the file size and will turn on if the file size is more than 100MB. The user can also fix a value that supersedes that condition.

msgoussi commented 2 years ago

i have checked, with progress = TRUE, and it worked fine. Thanks