[R] Question in Using sink function

Yao, Minghua yao6889 at msmailhub.oulan.ou.edu
Tue Sep 16 18:09:53 CEST 2003


Could anyone please explain to me why the following writes nothing into
"all.Rout"
file? If the "for" loop is removed, t.test output can be written into
"all.out".

Thanks in advance. 

Minghua Yao

 ......
  zz <- file("all.Rout", open="wt")
  sink(zz)
   
  for(i in 1:n)
  {	  
    Cy3<-X[,2*i-1];
    Cy5<-X[,2*i];
	
    t.test(Cy3, Cy5)
  }


  sink()
  close(zz)
......




More information about the R-help mailing list