Quantcast
Viewing all articles
Browse latest Browse all 3

Answer by Andre Wildberg for How to capture install.packages output in R with sink()?

You can use keep.outputs

install.packages("stringr", keep.outputs=TRUE)

from the help

if true, keep the outputs from installingsource packages in the current working directory, with thenames of the output files the package names with ‘.out’ appended ...

Note, instead of TRUE can be a character string of the directory where to save the output.


Also, there are several warnings and keep-in-minds regarding the usage of sink, like

Sink-ing the messages stream should be done only with great care.

and

Do not sink the messages stream unless you understand the sourcecode implementing it ...

Open and closing connections can be tricky and error prone, plus there might be operating system pitfalls and specificities etc.


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>