[Picante-commits] r115 - branches/gsoc/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Jun 21 07:30:58 CEST 2008
Author: mrhelmus
Date: 2008-06-21 07:30:58 +0200 (Sat, 21 Jun 2008)
New Revision: 115
Modified:
branches/gsoc/R/sppregs.R
Log:
Added the plot function to the sppregs.R file
Modified: branches/gsoc/R/sppregs.R
===================================================================
--- branches/gsoc/R/sppregs.R 2008-06-21 03:51:34 UTC (rev 114)
+++ branches/gsoc/R/sppregs.R 2008-06-21 05:30:58 UTC (rev 115)
@@ -106,4 +106,14 @@
return(list(family=fam,residuals=spp.resids,coefficients=spp.coef,std.errors=spp.se,cors.pa=cors.pa,cors.resid=cors.resid,cors.phylo=cors.phylo))
}
+}
+
+plot.sppregs<-function(sppreg,rows=c(1,3),cex.mag=1,x.label="phylogenetic correlations",y.label=c("occurrence correlations w/ env","occurrence correlations wo/ env","change in correlations")){
+ par(mfrow=rows,las=1,cex=cex.mag)
+ plot(sppreg$cors.phylo,sppreg$cors.pa,xlab=x.label,ylab=y.label[1],main=paste("cor =",round(cor(sppreg$cors.phylo,sppreg$cors.pa,use="pairwise.complete.obs"),4)))
+ abline(0,0,lty=2)
+ plot(sppreg$cors.phylo,sppreg$cors.resid,xlab=x.label,ylab=y.label[2],main=paste("cor =",round(cor(sppreg$cors.phylo,sppreg$cors.resid,use="pairwise.complete.obs"),4)))
+ abline(0,0,lty=2)
+ plot(sppreg$cors.phylo,sppreg$cors.resid-sppreg$cors.pa,xlab=x.label,ylab=y.label[3],main=paste("cor =",round(cor(sppreg$cors.phylo,sppreg$cors.resid-sppreg$cors.pa,use="pairwise.complete.obs"),4)))
+ abline(0,0,lty=2)
}
\ No newline at end of file
More information about the Picante-commits
mailing list