Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upknitr should interact better with `system` (R) #1203
Comments
This comment has been minimized.
This comment has been minimized.
I'm aware of this issue but I don't know a good answer. I posted a question on SO http://stackoverflow.com/q/36928322/559676 |
This comment has been minimized.
This comment has been minimized.
Great! A strange issue indeed. Seems |
This comment has been minimized.
This comment has been minimized.
Could My instincts tell me that's a terrible idea, but worth a suggestion. |
This comment has been minimized.
This comment has been minimized.
That is a natural thing to think about, but as you said, I'd not do it if we can find another way. |
This comment has been minimized.
This comment has been minimized.
It's just so strange how Hopefully there's a better way. |
yihui
closed this
in
yihui/evaluate@8960963
Oct 7, 2016
yihui
added this to the v1.15 milestone
Oct 7, 2016
This comment has been minimized.
This comment has been minimized.
You can install the development version of evaluate via devtools::install_github('hadley/evaluate') Then you can use this hack: evaluate::inject_funs(
system = function(...) cat(base::system(..., intern = TRUE), sep = "\n")
) and knitr will be able to capture the output of |
This comment has been minimized.
This comment has been minimized.
Neat trick. What's the benefit of using |
This comment has been minimized.
This comment has been minimized.
@MichaelChirico Well, no obvious advantages :) |
MichaelChirico commentedApr 28, 2016
•
edited
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:
The output of which is simply:
We can force the output to show up by hiding things from viewers:
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 anrmarkdown
problem); please advise if so.