[adegenet-commits] r468 - in pkg: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Nov 11 10:43:43 CET 2009


Author: jombart
Date: 2009-11-11 10:43:42 +0100 (Wed, 11 Nov 2009)
New Revision: 468

Modified:
   pkg/DESCRIPTION
   pkg/R/haploPop.R
Log:
Fix for dist.haploPop.
Some bugs seem to remain, but overall it works.


Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2009-11-10 19:35:51 UTC (rev 467)
+++ pkg/DESCRIPTION	2009-11-11 09:43:42 UTC (rev 468)
@@ -8,5 +8,4 @@
 Depends: methods
 Description: Classes and functions for genetic data analysis within the multivariate framework.
 License: GPL (>=2)
-LazyLoad: yes
-Collate: classes.R auxil.R handling.R genind2genpop.R propTyped.R basicMethods.R old2new.R makefreq.R chooseCN.R dist.genpop.R export.R setAs.R gstat.randtest.R HWE.R import.R monmonier.R coords.monmonier.R spca.R spca.rtests.R zzz.R hybridize.R fstat.R propShared.R scale.R colorplot.R loadingplot.R sequences.R seqTrack.R haploSim.R PCtest.R
+LazyLoad: yes
\ No newline at end of file

Modified: pkg/R/haploPop.R
===================================================================
--- pkg/R/haploPop.R	2009-11-10 19:35:51 UTC (rev 467)
+++ pkg/R/haploPop.R	2009-11-11 09:43:42 UTC (rev 468)
@@ -195,13 +195,14 @@
     }
 
     ## res <- outer(x, x, FUN=f1)
-    res <- numeric(n*(n-1)/2)
-    for(i in 1:n){
+    res <- matrix(0, ncol=n, nrow=n)
+    for(i in 1:(n-1)){
         for(j in (i+1):n){
-            res[]
+            res[i,j] <- f1(x[[i]], x[[j]])
         }
     }
 
-    temp <- dist(1:n)
+    res <- res+t(res)
+
     return(as.dist(res))
 } # end dist.haploPop



More information about the adegenet-commits mailing list