i wanted to use the sink function to sequentially output regression
summaries within a for-loop. i must have something wrong somewhere (or be
using the sink function incorrectly), but can anyone help?
hi all,
the code I am using is:
where data.x is a data.frame of independents, and data.y is a data.frame of dependents.
> for (i in 1:length(data.y)){
> taxa.i <- names(data.y[i])
>
jpeg(file=paste(taxa.i,".multiple.regress.residuals.1.RAW.jpeg",sep=""),
quality=90, width=1000, height=1000)
> par(mfrow=c(2,2), lwd=0.5, mar=c(3,4,3,1), bty="o", oma=c(0,3,2,0))
> attach(data.x)
> mult.reg.raw.i <- lm(data.y[,i] ~ CURRENT + LITTER + PERCURR + SUBST)
> plot(mult.reg.raw.i, ask=FALSE)
> mtext(names(data.y[i]), side=3, line=-1.5, adj=0.48, cex=0.75,
outer=TRUE)
> dev.off()
> sink("mulptiple regression - summary RAW.txt", append=TRUE)
> summary(mult.reg.raw.i)
> sink()
> }
cheers,
tony
tony dell
department of marine and tropical biology james cook university townsville,
qld 4811 australia
[p] 07 47815751 or 47814520 [e] anthony.dell_at_jcu.edu.au [skype] anphony
Checked by AVG.
6:27 PM
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 - 05: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.