-
-
Notifications
You must be signed in to change notification settings - Fork 879
Closed
Milestone
Description
As highlighted by this question, we sort of have to jump through hoops to get the output from a system call to print its output to HTML.
Consider the following simple .Rmd file:
---
output: html_document
---
```{r test, echo = TRUE}
system("ls")
```
The output of which is simply:
system("ls")
We can force the output to show up by hiding things from viewers:
---
output: html_document
---
```{r test, echo = TRUE, eval = FALSE}
system("ls")
```
```{r test_eval, echo = FALSE, eval = TRUE}
cat(system("ls", intern = TRUE), collapse = "\n")
```
Which produces the output one would expect from simply running the first chunk.
But this seems like a sub-optimal solution and I think runs antithetical to the spirit of knitr.
I'm not 100% sure this is a knitr problem (as opposed to an rmarkdown problem); please advise if so.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels