[adegenet-commits] r747 - pkg/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Dec 25 01:58:28 CET 2010
Author: jombart
Date: 2010-12-25 01:58:28 +0100 (Sat, 25 Dec 2010)
New Revision: 747
Modified:
pkg/R/SNPbin.R
Log:
Fixed examples commented at the end of the code.
Various levels of ploidy work.
Differences in compression efficiency came from using integers or numeric (doubles) as inputs.
Modified: pkg/R/SNPbin.R
===================================================================
--- pkg/R/SNPbin.R 2010-12-25 00:22:55 UTC (rev 746)
+++ pkg/R/SNPbin.R 2010-12-25 00:58:28 UTC (rev 747)
@@ -322,16 +322,22 @@
################################
## testing :
##
-## HAPLOID DATA
##
## library(adegenet)
-## dat <- sample(c(0L,1L,NA), 1e6, prob=c(.5, .495, .005), replace=TRUE)
+## HAPLOID DATA - NO NA
+## dat <- sample(c(0,1), 1e6, replace=TRUE)
## x <- new("SNPbin", dat)
+## identical(as(x, "integer"),dat) # SHOULD NORMALLY BE TRUE
+## all(as(x, "integer") == dat, na.rm=TRUE) # MUST BE TRUE
+## object.size(dat)/object.size(x) # EFFICIENCY OF CONVERSION
+
+## HAPLOID DATA - WITH NAs
+## dat <- sample(c(0,1,NA), 1e6, prob=c(.5, .49, .01), replace=TRUE)
+## x <- new("SNPbin", dat)
## identical(as(x, "integer"),dat) # SHOULD NORMALLY BE TRUE
## all(as(x, "integer") == dat, na.rm=TRUE) # MUST BE TRUE
-
## object.size(dat)/object.size(x) # EFFICIENCY OF CONVERSION
More information about the adegenet-commits
mailing list