[adegenet-commits] r397 - pkg/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Jun 12 00:20:41 CEST 2009
Author: jombart
Date: 2009-06-12 00:20:40 +0200 (Fri, 12 Jun 2009)
New Revision: 397
Modified:
pkg/R/haploSim.R
pkg/R/seqTrack.R
Log:
god damn. .as.d a.sd. a.sd
Modified: pkg/R/haploSim.R
===================================================================
--- pkg/R/haploSim.R 2009-06-11 21:58:49 UTC (rev 396)
+++ pkg/R/haploSim.R 2009-06-11 22:20:40 UTC (rev 397)
@@ -92,6 +92,7 @@
}
} else { # use location-dependent proba of dispersal between locations
if(any(matConnect < 0)) stop("Negative values in matConnect (probabilities expected!)")
+ matConnect <- prop.table(matConnect,1)
xy.dupli <- function(cur.xy, nbLoc){
## lambda.xy <- matConnect[cur.xy[1] , cur.xy[2]]
## mvt <- rpois(2*nbLoc, lambda.xy) * sample(c(-1,1), size=2*nbLoc, replace=TRUE)
Modified: pkg/R/seqTrack.R
===================================================================
--- pkg/R/seqTrack.R 2009-06-11 21:58:49 UTC (rev 396)
+++ pkg/R/seqTrack.R 2009-06-11 22:20:40 UTC (rev 397)
@@ -697,6 +697,8 @@
ances.support <- rep(1,length(temp))
} else {
f1 <- function(tab){
+ if(length(tab)==0) return(NA)
+
res <- names(tab)[tab==max(tab)]
## if(length(res)==1) return(res)
## return(NA)
More information about the adegenet-commits
mailing list