Is there a way of showing formatter R output in rmarkdown/knitr when using results = 'asis'?
An example would be the following function:
myfun <- function() {
cat("hello!\n")
cat(c("one" = 1, "two" = 2))
}
Then, this chunk will print the second cat
on a new row:
```{r}
myfun()
```
But this will ignore the formatting from myfun
:
```{r, results = "asis"}
myfun()
```
Is there a way of keeping results='asis'
but at the same time keep the output of myfun
formatted as intended?