show markdown execution in console


#1

Hello,
Usually, i use rmarkdown's function render to generate my interactive reports. My question is how can i get my execution printing in R console? for example when i run .Rmd file which contains this code:

for(i in 1:400000){
  Sys.sleep(2)
  print(i)
}

I want to see i's printing in my R console before the html output file will be created.

Thank you for your help.


#2

I think one trick could be to use message(i) and use message=FALSE as option for this chunk .
Doing this, the message won't be include in the html output and redirectes to the console where render is called.

Not sure but worth a try! :wink:


#3

Thanks! for your help :slight_smile: i will try it.