Re: [R] using the sink() function in a for-look

From: Johannes Hüsing <>
Date: Thu, 01 May 2008 11:44:49 +0200

Rolf Turner <> [Thu, May 01, 2008 at 06:59:29AM CEST]:
> On 1/05/2008, at 4:40 PM, Johannes Hüsing wrote:

> >
> >When you do the following:
> >
> >for (i in 1:100) {
> > summary(rnorm(80))}
> >
> >what output do you get?
> He'd get nothing at all.

That's the point.

> Did you ***try*** your code?
> >And all this output
> ``All this output''! Consisting of the empty set !!!

Hm, I thought this group would be mathematically inclined enough not to single out the empty set as a special case.

> >is redirected to your file by sink(), so it works
> >as expected.
> That all depends on what you expect, I guess.

I upgraded my expectations after keying ?sink and reading.

> Most people
> would expect to get some output. As Tony expected.

I readily concede that your answer was taking it easier on the beginner than mine.

Johannes Hüsing               There is something fascinating about science. 
                              One gets such wholesale returns of conjecture  from such a trifling investment of fact.                (Mark Twain, "Life on the Mississippi")

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Thu 01 May 2008 - 09:53:29 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 01 May 2008 - 13:30:34 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive