{"id":32200193,"url":"https://github.com/rmflight/knitrprogressbar","last_synced_at":"2026-02-19T23:01:12.053Z","repository":{"id":56937331,"uuid":"118857813","full_name":"rmflight/knitrProgressBar","owner":"rmflight","description":"progress bars that can provide information from inside knitr calls","archived":false,"fork":false,"pushed_at":"2024-07-23T17:24:25.000Z","size":360,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-01T00:00:04.737Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rmflight.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-01-25T03:37:08.000Z","updated_at":"2024-07-23T17:24:29.000Z","dependencies_parsed_at":"2025-09-08T15:25:01.057Z","dependency_job_id":"e6b5b9eb-3410-4028-ac9a-bbade59cd6e0","html_url":"https://github.com/rmflight/knitrProgressBar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rmflight/knitrProgressBar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmflight%2FknitrProgressBar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmflight%2FknitrProgressBar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmflight%2FknitrProgressBar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmflight%2FknitrProgressBar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rmflight","download_url":"https://codeload.github.com/rmflight/knitrProgressBar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmflight%2FknitrProgressBar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29636035,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T22:32:43.237Z","status":"ssl_error","status_checked_at":"2026-02-19T22:32:38.330Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-22T03:41:41.692Z","updated_at":"2026-02-19T23:01:12.042Z","avatar_url":"https://github.com/rmflight.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: rmarkdown::github_document\n---\n\n[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/knitrProgressBar)](https://cran.r-project.org/package=knitrProgressBar) \n[![GH_Status_Badge](https://github.com/rmflight/knitrProgressBar/actions/workflows/r.yml/badge.svg)](https://github.com/rmflight/knitrProgressBar/actions/workflows/r.yml)\n\n\n## knitrProgressBar\n\n[This package](https://rmflight.github.io/knitrProgressBar/) supplies a progress bar (shamelessly borrowed from `dplyr::progress_estimated`)\nthat has options to **not** have output captured inside a `knitr` chunk.\n\n### Installation\n\nThis package can be installed from CRAN by:\n\n```\ninstall.packages(\"knitrProgressBar\")\n```\n\nTo install the development version of this package, use `remotes`:\n\n```\nremotes::install_github(\"rmflight/knitrProgressBar\")\n```\n\n## Problem\n\nYou want to use `knitr` or `rmarkdown`, but you want to see the progress of a longer running calculation\nin the chunk. You think that you can just use `dplyr::progress_estimated`. But if\nyou do, all the output from the progress bar will be suppressed \n([by design, actually](https://github.com/tidyverse/dplyr/blob/master/R/progress.R#L96)).\n\n## Solution\n\nThis package has two functions, `progress_estimated`, that creates a `Progress` object\nthat has a connection object associated with it, and `update_progress`, that properly updates the progress object. The output from the progress\nwill be written to **that** connection. This connection will be either\n`stdout` (default within an R session), `stderr` (default from within `knitr`),\nor to a log-file.\n\n## Examples\n\nNone of these are run in this document!\n\n### Setup\n\n```{r setup, eval = FALSE}\nlibrary(knitrProgressBar)\n\n# borrowed from example by @hrbrmstr\narduously_long_nchar \u003c- function(input_var, .pb=NULL) {\n  \n  update_progress(.pb)\n  \n  Sys.sleep(0.5)\n  \n  nchar(input_var)\n  \n}\n```\n\n### Let Function Decide\n\nIf you want the object to decide where to put output, do nothing. Just call\nthe `progress_estimated()` function, which uses `make_kpb_output_decisions()`:\n\n```{r decide_itself, eval = FALSE}\npb \u003c- progress_estimated(length(letters))\n\npurrr::map_int(letters, arduously_long_nchar, .pb = pb)\n```\n\nSee the help and the vignette for an explanation of how `make_kpb_output_decisions()` decides\nwhere to display the progress bar output.\n\n### Write to Specific Connection\n\nIf you want to write the progress out to a specific connection, just pass the connection\nto the `progress_estimated()` call:\n\n```{r test_pb, eval = FALSE}\npb \u003c- progress_estimated(length(letters), progress_location = stdout())\n\npurrr::map_int(letters, arduously_long_nchar, .pb = pb)\n```\n\nThis includes specific files. You can then display the file, or use `tailf` or\nequivalent to watch the output of the file.\n\n```{r file_con, eval = FALSE}\npb \u003c- progress_estimated(length(letters), progress_location = file(\"progress.log\", open = \"w\"))\n\npurrr::map_int(letters, arduously_long_nchar, .pb = pb)\n```\n\n## Connection Considerations\n\nEach connection will display in specific situations, notably `stdout()`\nwill not display to the terminal when run as part of a document being `knit`ted.\n\n## Inspiration\n\nThis package (and the examples) was inspired by [this post](https://rud.is/b/2017/03/27/all-in-on-r%E2%81%B4-progress-bars-on-first-post/) from Bob Rudis! Also, thanks to Hadley Wickham for the great `Progress` object and methods!\n\n## Website\n\nWeb accessible documentation is available [here](https://rmflight.github.io/knitrProgressBar/).\n\n## Bug Reports\n\nPlease submit bug reports using the GitHub [issue tracker](https://github.com/rmflight/knitrProgressBar/issues).\n\n## Code of Conduct\n\nPlease note that this project is released with a [Contributor Code of Conduct](https://github.com/rmflight/knitrProgressBar/blob/main/CONDUCT.md). By participating in this project you agree to abide by its terms.\n\n## License\n\nThis package is licensed using an [MIT license](https://github.com/rmflight/knitrProgressBar/blob/main/LICENSE.md), copyright Robert M Flight.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmflight%2Fknitrprogressbar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frmflight%2Fknitrprogressbar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmflight%2Fknitrprogressbar/lists"}