When knitting an R markdown file, I often find myself staring at the Markdown output waiting for a chunk to finish. Unfortunately, I don't know of any way of seeing what command that chunk is currently executing. This would be handy to get a sense of the progress, or to find performance bottlenecks.
Is there some knitr option I have missed ? Setting progress=TRUE, verbose=TRUE
just shows the chunk code before that chunk is executed. I want each line of code to be shown in the console just after/before it is executed, just like in an interactive session.
Next to Console tab at the bottom, you will see R Markdown tab, all steps can be seen there, see screenshot below:
EDIT 1: We need to set up global options opts_knit$set(progress = TRUE, verbose = TRUE)
Example:
---
title: "Untitled"
output: html_document
---
```{r global_options, include=FALSE}
library(knitr)
opts_knit$set(progress = TRUE, verbose = TRUE)
```
This is an R Markdown document. Markdown is a simple ...
```{r SummaryCars}
summary(cars)
```
Output on R Markdown window:
processing file: temppp.Rmd
|................ | 25%
ordinary text without R code
|................................ | 50%
label: global_options (with options)
List of 1
$ include: logi FALSE
|................................................. | 75%
ordinary text without R code
|.................................................................| 100%
label: SummaryCars
~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~
summary(cars)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##------ Fri Jul 17 09:00:42 2015 ------##
output file: temppp.knit.md
EDIT 2: This answer doesn't meet OP's requirement, keeping this answer as an example to illustrate OP's code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With