[adegenet-commits] r699 - pkg/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Oct 21 18:00:01 CEST 2010
Author: jombart
Date: 2010-10-21 18:00:01 +0200 (Thu, 21 Oct 2010)
New Revision: 699
Modified:
pkg/R/dapc.R
Log:
fixed a bug in the new 1-dim scatter
Modified: pkg/R/dapc.R
===================================================================
--- pkg/R/dapc.R 2010-10-21 15:51:19 UTC (rev 698)
+++ pkg/R/dapc.R 2010-10-21 16:00:01 UTC (rev 699)
@@ -278,16 +278,17 @@
add.scatter.eig(x$eig, ncol(x$loadings), axes[1], axes[2], posi=posi, ratio=ratio, csub=csub)
}
} else {
- ## get densities
- ldens <- tapply(x$ind.coord[,1], x$grp, density)
- allx <- unlist(lapply(ldens, function(e) e$x))
- ally <- unlist(lapply(ldens, function(e) e$y))
+ ## get plotted axis
if(ncol(x$ind.coord)==1) {
pcLab <- 1
} else{
pcLab <- xax
}
- par(bg=bg)
+ ## get densities
+ ldens <- tapply(x$ind.coord[,pcLab], x$grp, density)
+ allx <- unlist(lapply(ldens, function(e) e$x))
+ ally <- unlist(lapply(ldens, function(e) e$y))
+ par(bg=bg)
plot(allx, ally, type="n", xlab=paste("Discriminant function", pcLab), ylab="Density")
for(i in 1:length(ldens)){
lines(ldens[[i]]$x,ldens[[i]]$y, col=col[i], lwd=2)
More information about the adegenet-commits
mailing list