[Rcolony-commits] r69 - pkg/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Jul 12 15:38:34 CEST 2012
Author: jonesor
Date: 2012-07-12 15:38:34 +0200 (Thu, 12 Jul 2012)
New Revision: 69
Modified:
pkg/R/build.colony.input.R
Log:
Bug fix in build.colony.input - via Jarrod Hadfield
Modified: pkg/R/build.colony.input.R
===================================================================
--- pkg/R/build.colony.input.R 2012-04-07 17:26:09 UTC (rev 68)
+++ pkg/R/build.colony.input.R 2012-07-12 13:38:34 UTC (rev 69)
@@ -633,7 +633,7 @@
#Paternal Dyads
-if(dim(colonyfile$paternal.dyads)[1]==0){
+if(is.null(colonyfile$paternal.dyads)){
write.table("0 !Number of known paternities",name,append=TRUE,quote=FALSE,row.names=FALSE,col.names=FALSE)
write("",name,append=TRUE)}else{
write.table(paste(dim(colonyfile$paternal.dyads)[1],"!Number of known paternities"),name,append=TRUE,quote=FALSE,row.names=FALSE,col.names=FALSE)
@@ -643,7 +643,7 @@
write("",name,append=TRUE)}
#Maternal Dyads
-if(dim(colonyfile$maternal.dyads)[1]==0){
+if(is.null(colonyfile$maternal.dyads)){
write.table("0 !Number of known maternities",name,append=TRUE,quote=FALSE,row.names=FALSE,col.names=FALSE)
write("",name,append=TRUE)}else{
write.table(paste(dim(colonyfile$maternal.dyads)[1],"!Number of known maternities"),name,append=TRUE,quote=FALSE,row.names=FALSE,col.names=FALSE)
@@ -654,7 +654,7 @@
#Paternal sibships
-if(dim(colonyfile$paternal.sibships)[1]==0){
+if(is.null(colonyfile$paternal.sibships)){
write.table("0 !Number of known paternal sibships with unknown fathers",name,append=TRUE,quote=FALSE,row.names=FALSE,col.names=FALSE)
write("",name,append=TRUE)}else{
write.table(paste(dim(colonyfile$paternal.sibships)[1],"!Number of known paternal sibships with unknown fathers "),name,append=TRUE,quote=FALSE,row.names=FALSE,col.names=FALSE)
@@ -663,7 +663,7 @@
#Maternal sibships
-if(dim(colonyfile$maternal.sibships)[1]==0){
+if(is.null(colonyfile$maternal.sibships)){
write.table("0 !Number of known maternal sibships with unknown mothers",name,append=TRUE,quote=FALSE,row.names=FALSE,col.names=FALSE)
write("",name,append=TRUE)}else{
write.table(paste(dim(colonyfile$maternal.sibships)[1],"!Number of known maternal sibships with unknown mothers "),name,append=TRUE,quote=FALSE,row.names=FALSE,col.names=FALSE)
More information about the Rcolony-commits
mailing list