Re: [R] problems with for loop

From: Michael T. Mader <>
Date: Tue 16 Jan 2007 - 14:17:05 GMT

If you really want the summary() etc to print to STDOUT use cat() or print(). However other ways to post-process results may be preferrable, I think about Sweave, xtable, etc.



Jorge Lampurlanes Castel wrote:
> Hello,
> With this program I try to repeat analysis for different years. The
> results of the analysis are not printed when in the loop, except for the
> year sequence. What is wrong?
> Thanks a lot.
> for (i in 92:99){
> cat("\n",
> "=============================================================\n",
> "YEAR =",i,"\n",
> "=============================================================\n"
> )
> canos1 <- subset (canos, canos$YEAR==i)
> LinearModel.1 <- lm(MM_P ~ BLOC + TIL, data=canos1)
> summary(LinearModel.1)
> Anova(LinearModel.1, type="II")
> Anova(LinearModel.1, type="III")
> }

Michael T. Mader
Institute of Stem Cell Research
GSF - National Research Center for Environment and Health
Ingolstaedter Landstrasse 1
D-85764 Neuherberg

The limits of my language are the limits of my world.
	Ludwig Wittgenstein Tractatus Logico-Philosophicus 5.6, 1918

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Wed Jan 17 01:23:50 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 16 Jan 2007 - 15:30:28 GMT.

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