In R, how to get output to both the file and the console at the same time?

I want only the output of no commands, and I want to see the output on the console at the same time.

I tried sink and capture.output, but tried to work with examples, but I can only do one of the tasks, for example, for the console or for a file.

I am new to R and was thinking if there is a function that can help me see the output on the console and save it to a text file?

+4
source share
1 answer

Do sink(file="file.txt", split=TRUE) .

+8
source

Source: https://habr.com/ru/post/1486485/


All Articles