how to write text into a file
[...]
We have found that the command postscript() puts the graphics into a postscript file. With the command text(), text may be added into graphics. But the text ouput of commands like max(), median()... will only be put on the screen.
Not if you use
sink("fileyouwant") to begin the redirecting into the
file you want
and
sink()
to stop redirecting into the named file.
See ?sink