You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is a reprex. Sorry for the cpp11 stuff, but it was easier for me to write it like this than trying to remember how to create a named list with the C API functions.
This would need the dev version of cpp11, as there is a bug in the current CRAN release related to the use of cpp11::linking_to.
cpp11::cpp_source(code='#include <cpp11.hpp> #include <cli/progress.h>[[cpp11::linking_to("cli")]][[cpp11::register]]void pb() { int i; using namespace cpp11::literals; cpp11::writable::list config({"clear"_nm = false, "format_done"_nm = "Completed in {cli::pb_elapsed}."}); SEXP bar = PROTECT(cli_progress_bar(1000, config)); for (i = 0; i < 1000; i++) { cli_progress_sleep(0, 4 * 1000 * 1000); if (CLI_SHOULD_TICK) cli_progress_set(bar, i); } cli_progress_done(bar); UNPROTECT(1);}')
pb()
E.g.
format_done = "Completed in {cli::pb_elapsed}"
.The text was updated successfully, but these errors were encountered: