3
votes

I am currently working on a .Rmd notebook, RStudio version 1.1.442.

Following the Knitr manual and different examples found also in various vignette, in my notebook I've asked readr (installed version: 1.1.1) not to show progress bar using a hidden code blok:

```{r global_opts, echo=FALSE}
options(readr.show_progress = FALSE)
```

Without this specification, the document is annoyingly rendered with each percentual step of readr progress bar (if I remember correctly, once, the rendering process returned just the 'Parsed with column specification' message).

Already tried:

  • Setting in the chunck options results='hide' or echo = FALSE: these options do not fit my needs, as they suppress also the column specification;

  • Setting chunk option warning=FALSE does not suppress col specification nor the progress bar printing;

From the Chunk Options section in the RStudio's RMarkdown website:

  • include = FALSE prevents code and results from appearing in the finished file. R Markdown still runs the code in the chunk, and the results can be used by other chunks.
  • echo = FALSE prevents code, but not the results from appearing in the finished file. This is a useful way to embed figures.
  • message = FALSE prevents messages that are generated by code from appearing in the finished file.
  • warning = FALSE prevents warnings that are generated by code from appearing in the finished.

I am looking for a way to keep the progress bar in the console, without having it renderd in the final HTML/PDF rendered document.

Thanks.

1
I found an article that seems to deal with exactly this question, with a few different usage examples: rmflight.github.io/knitrProgressBar/articles/… They seem to indicate using some extra package for piping the progress bar output connection to some place other than stdout.Matthew Strasiotto

1 Answers

0
votes

You can use the readr function show_progress.

read_delim("myFile", progress = show_progress())

This will show the progress bar only when running the command in console, but not in an interactive markdown document.