I would like to capture the complete output of the install.packages command in a variable. However, the messages that are printed during the installation are a result of calling system() with intern=FALSE. As a result they are not really messages/warnings/print. Is there any way to capture this information into a variable? E.g.
> sink(tempfile())
> bla <- suppressMessages(suppressWarnings(capture.output(system('whoami'))));
jeroen
Or:
> sink(tempfile())
> bla <- suppressMessages(suppressWarnings(capture.output(install.packages("XML"))));
Still prints everything to screen…
You can launch a separate R process: