[adegenet-commits] r384 - pkg/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Jun 8 19:59:05 CEST 2009
Author: jombart
Date: 2009-06-08 19:59:05 +0200 (Mon, 08 Jun 2009)
New Revision: 384
Modified:
pkg/R/seqTrack.R
Log:
fixes to get.consensus
Modified: pkg/R/seqTrack.R
===================================================================
--- pkg/R/seqTrack.R 2009-06-08 17:52:46 UTC (rev 383)
+++ pkg/R/seqTrack.R 2009-06-08 17:59:05 UTC (rev 384)
@@ -677,8 +677,9 @@
temp <- apply(listres$ances, 1, table)
## compute compromise
- if(is.vector(temp)){
+ if(!is.list(temp)){
newances <- temp
+ ances.support <- rep(1,length(temp))
} else {
f1 <- function(tab){
res <- names(tab)[tab==max(tab)]
@@ -688,6 +689,7 @@
newances <- sapply(temp, f1)
ances.support <- sapply(temp, function(e) max(e, na.rm=TRUE)/sum(e, na.rm=TRUE))
+ ances.support[is.na(newances)] <- NA
}
## form the output
More information about the adegenet-commits
mailing list