[R] sink() not working as expected

Rich Shepard r@hep@rd @end|ng |rom @pp|-eco@y@@com
Tue Nov 2 20:52:27 CET 2021


On Tue, 2 Nov 2021, Bert Gunter wrote:

> What do you think these 2 lines are doing?
> cat ('corvalis discharge summary\n')
> print(cat)

Bert,

If I used them in linux cat would display the file (as do more and less) and
print() would be replaced with lpr

> Please consult ?cat . You might also spend a bit of (more?) time with an R
> tutorial or two as you seem confused about how assignment (<-) works. Or
> maybe I'm confused about what is confusing you....

Having never before needed to use cat in R, and not seeing it explained in
the one sink() web page, I didn't think to look at the help page.

Now, using cat and not print line-by-line the first set of commands work,
but not the second.

More reading coming up.

Rich



More information about the R-help mailing list