powered by
With one sink, then release
.rxWithSink(file, code)
the path to the file sink while running the code
code
The code to run during the sink
Will return the results of the code section
.rxWithSink captures output from cat
.rxWithSink
cat
.rxWithSinkBoth captures output from cat and message
.rxWithSinkBoth
message
# NOT RUN { t <- tempfile() .rxWithSink(t, cat("message\n")) cat("cat2\n") # now you can see the cat2 lines <- readLines(t) unlink(t) # }
Run the code above in your browser using DataLab