[Rcolony-commits] r81 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Dec 10 16:10:15 CET 2012


Author: jonesor
Date: 2012-12-10 16:10:15 +0100 (Mon, 10 Dec 2012)
New Revision: 81

Modified:
   pkg/R/get.colony.data.R
Log:
Fixed code to obtain offspring rows by row number rather than from Grepping the comment

Modified: pkg/R/get.colony.data.R
===================================================================
--- pkg/R/get.colony.data.R	2012-12-10 14:16:15 UTC (rev 80)
+++ pkg/R/get.colony.data.R	2012-12-10 15:10:15 UTC (rev 81)
@@ -22,9 +22,9 @@
     ###################################################
     #Lists of offspring, fathers and mothers
     ###################################################
-    offspring <- x[grep("!Offspring ID and genotypes",x):(grep("!Prob that the dad and mum of an offspring included in candidates", x) - 2)] #M for male, F for female
-    offspring <- offspring[offspring != ""]
-    
+    # Starts at line 24 - 24+(n-1)
+    offspring <-x[24:(24+(n-1))]
+
     fathers <- x[grep("!Candidate M ID and genotypes",x):(grep("!Candidate F ID and genotypes",x) - 2)] #M for male, F for female
     fathers <- fathers[fathers != ""]
     



More information about the Rcolony-commits mailing list