How can I capture CLI tool file output to R object or stdout?
问题 I'm calling a bunch of command-line interface (CLI) tools (such as texi2pdf or pdf2svg from an R script, and I'd like to capture the output file of these tools directly as an R object, without touching the file system . This is the opposite concern of the more frequent "how-do-I-redirect-stdout-to-file"-question. (Perhaps that implies that I'm "using it wrong"). Example : Say, I have a simple latex reprex.tex file that I'd like to compile: \documentclass{article} \begin{document} Foo. \end