[adegenet-commits] r743 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Dec 22 17:27:12 CET 2010


Author: jombart
Date: 2010-12-22 17:27:12 +0100 (Wed, 22 Dec 2010)
New Revision: 743

Modified:
   pkg/R/SNPbin.R
Log:
Proper show method


Modified: pkg/R/SNPbin.R
===================================================================
--- pkg/R/SNPbin.R	2010-12-22 16:12:52 UTC (rev 742)
+++ pkg/R/SNPbin.R	2010-12-22 16:27:12 UTC (rev 743)
@@ -152,21 +152,37 @@
 ## show method
 ##############
 setMethod ("show", "SNPbin", function(object){
+    cat(" === S4 class SNPbin ===")
+    if(!is.null(x at label)) {
+        cat("\n", x at label)
+    }
+    cat("\n", nLoc(object), "SNPs coded as bits")
+    temp <- round(length(object at NA.posi)/nLoc(object) *100,2)
+    cat("\n", length(object at NA.posi), " (", temp," %) missing data\n", sep="")
+}) # end show method
 
-    cat("\n", )
 
-  cat("\n at call: ")
-  print(x at call)
-}) # end show method
 
 
 
+############
+## accessors
+############
+setMethod("nLoc","SNPbin", function(x,...){
+    return(x at n.loc)
+})
 
 
 
 
 
 
+
+
+
+
+
+
 ################################
 ## testing :
 ##



More information about the adegenet-commits mailing list