ropensci / popler

The R package to browse and query the popler database
https://docs.ropensci.org/popler
MIT License
8 stars 7 forks source link

Progress bar for downloads with `get_data` #34

Open AldoCompagnoni opened 7 years ago

AldoCompagnoni commented 7 years ago

Can we devise a progress bar to show progress when downloading data sets using get_data?

bochocki commented 7 years ago

The "progress" package may be helpful here. From the docs (https://cran.r-project.org/web/packages/progress/progress.pdf)

Tokens They can be used in the format argument when creating the progress bar.

:bar The progress bar itself. :current Current tick number. :total Total ticks. :elapsed Elapsed time in seconds. :eta Estimated completion time in seconds. :percent Completion percentage. :rate Download rate, bytes per second. See example below. :bytes Shows :current, formatted as bytes. Useful for downloads or file reads if you don’t know the size of the file in advance. See example below. :spin Shows a spinner that updates even when progress is advanced by zero.

Custom tokens are also supported, and you need to pass their values to progress_bar$tick() or progress_bar$update(), in a named list. See example below.