‘Knit’ing a document from my markdown file, to word or PDF, the text portions are nicely formatted. In this r-chunk I have a text string (in my if/else statement):
```{r echo=FALSE}
z <- df[is.na(df$column1) | is.na(df$column2) | is.na(df$column3), ]
z <- select(z, column1, column2, column3)
if(nrow(z) == 0){
print(”Alternative line of text”)
} else{
kable(z)
}
This gives the typical R-format of the text string "Alternative..." in the generated document:
## [1] "Alternative line of text"
Is there a function other than ”print” to display the text string from the chunk as formatted text, without the “## [1]” (just show it as the rest of the paragraph text)?
(I tried google and searching this site but the lack of vocabulary of exacly what I´m looking for, the tries were unsucessful.)
Edit: The suggested duplicate post did not give me the answer, but the comment given below did!