Knitting a specific portion the the markdown file

Hi everyone,

  1. Is there an option in Rmarkdown where I can only knit a specific portion of the file. I wanna see how a selected part will appear in the final PDF without having to render the whole file every time.

  2. When I try to insert an inline code using r <code>, the output won't appear in the final pdf. any ideas what might be causing the issue?

Thank you :slightly_smiling_face:

1 Like

Hello @Mohamed_Fergany ,

You could use

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE,eval=FALSE)

in your first chunk (mark the eval=FALSE) and specify eval=TRUE in the R chunks that you do want evaluated. Depending on calculations in the the non-evaluated chunks this could save you some time.
However the text-part (outside the R-chunks) will still be rendered.
So if this is helpful: you decide !?

Concerning the inline code: show us the code that you want to use in context.

1 Like

Hi @HanOostdijk ,
Thanks for your help. I've found another Solution regarding my first inquiry.

Now regarding the second one, I was learning this (new to me) feature and I've tried multiple codes but I didn't get any results
This was one of them r print("This is an inline code output") but I haven't got any results after knitting though :pensive:

Ok I've found the solution. Just use paste("text") instead of print().

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.