sink() sink(file)
file
| a character string naming the file to write to. |
sink(file) diverts all R output to file (overwriting the
file if it already exists; appending is not supported yet). Only
prompts and error messages continue to appear on the terminal.
sink() ends the diversion.