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

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

Rolf Turner <r.turner_at_auckland.ac.nz> [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 
mailto:johannes_at_huesing.name  from such a trifling investment of fact.                
http://derwisch.wikidot.com         (Mark Twain, "Life on the Mississippi")

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
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 https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive