Last active
August 29, 2015 14:24
-
-
Save noamross/b902d1cda9bedb1bd060 to your computer and use it in GitHub Desktop.
Capturing all console output, including messages from C programs, etc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
conn <- textConnection("printed_output", "w", local = TRUE) | |
sink(conn, type=c("output")) | |
sink(conn, type=c("message")) | |
install.packages("ggplot2") | |
sink(NULL) | |
printed_output | |
# This will append the text to the printed_output variable, so clear it beforehand. | |
#If you get errors in install and your console output disappears, do | |
# for(i in seq.along(sink.number()) sink(NULL) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Well, this is weird