[Picante-commits] r246 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Oct 12 20:02:49 CEST 2013


Author: jmaspons
Date: 2013-10-12 20:02:48 +0200 (Sat, 12 Oct 2013)
New Revision: 246

Modified:
   pkg/R/phylosignal.R
Log:
Correct a bug in multiPhylosignal when there are NAs in traits

Modified: pkg/R/phylosignal.R
===================================================================
--- pkg/R/phylosignal.R	2013-05-31 19:21:13 UTC (rev 245)
+++ pkg/R/phylosignal.R	2013-10-12 18:02:48 UTC (rev 246)
@@ -77,13 +77,14 @@
 	trait <- x[,1]
 	names(trait) <- row.names(x)
 	pruned <- prune.missing(trait,phy)
-	output <- data.frame(phylosignal(pruned$data,pruned$tree,...))
+	attributes(pruned$data)$na.action<- NULL
+	output <- data.frame(phylosignal(pruned$data, pruned$tree, ...))
 	if(length(colnames(x))>1) {
 		for (i in 2:length(colnames(x))) {
 			trait <- x[,i]
 			names(trait) <- row.names(x)
 			pruned <- prune.missing(trait, phy)
-			trait <- trait[phy$tip.label]
+                        attributes(pruned$data)$na.action<- NULL
 			output <- rbind(output, phylosignal(pruned$data, pruned$tree, checkdata=FALSE, ...))
 		}
 	}



More information about the Picante-commits mailing list