Print a message to the R markdown console while knitting

I'm wondering if there is a way to print a message containing one of the variables in the Rmarkdown console at the end of knitting?

I am currently preparing an R Markdown template for other users. I would like to inform users about the readability index of the document after compilation is complete. I already found a way to calculate it in one of the chunks. Now I would like to automatically print it out for the person who will compile it in such a way that it does not appear in the final document. Any ideas?

+4


source to share


2 answers


Ben Bolkers' comment is the perfect answer. I ended up putting:

{r cache = FALSE, echo = F, warning = F, message = F}
message(rdblty)

      



at the very bottom of the markdown file. rdblty

is a variable computed before what I wanted to print.

+4


source


What about?



    cat(file="readability.txt")

      

+2


source







All Articles