[Picante-commits] r35 - in pkg: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Mar 3 00:06:55 CET 2008


Author: skembel
Date: 2008-03-03 00:06:54 +0100 (Mon, 03 Mar 2008)
New Revision: 35

Modified:
   pkg/R/phylosignal.R
   pkg/man/Kcalc.Rd
   pkg/man/phylosignal.Rd
Log:
Bugfix in phylosignal and documentation

Modified: pkg/R/phylosignal.R
===================================================================
--- pkg/R/phylosignal.R	2008-03-02 22:52:00 UTC (rev 34)
+++ pkg/R/phylosignal.R	2008-03-02 23:06:54 UTC (rev 35)
@@ -22,12 +22,6 @@
 	return(K)
 }
 
-df2vec <- function(x, colID=1) {
-	vec <- x[,colID]
-	names(vec) <- row.names(x)
-	vec
-}
-
 pic.variance <- function(x,phy,scaled=TRUE) {
 	pics <- pic(x,phy,scaled)
 	N <- length(pics)
@@ -45,7 +39,7 @@
     }
 	
 	obs.var.pic = pic.variance(x,phy,...)
-	    
+	
 	rnd.var.pic <- numeric(reps)
 	
 	#significance based on tip shuffle
@@ -58,7 +52,6 @@
 	var.pics = c(obs.var.pic,rnd.var.pic)
 	var.pics.p = rank(var.pics)[1] / (reps + 1)
 	var.pics.z = (obs.var.pic - mean(var.pics))/sd(var.pics)
+    data.frame(K,PIC.variance.obs=obs.var.pic,PIC.variance.rnd.mean=mean(var.pics),PIC.variance.P=var.pics.p, PIC.variance.Z=var.pics.z)
 
-	data.frame(K,PIC.variance=obs.var.pic,PIC.variance.P=var.pics.p, PIC.variance.Z=var.pics.z)
-
 }

Modified: pkg/man/Kcalc.Rd
===================================================================
--- pkg/man/Kcalc.Rd	2008-03-02 22:52:00 UTC (rev 34)
+++ pkg/man/Kcalc.Rd	2008-03-02 23:06:54 UTC (rev 35)
@@ -10,7 +10,7 @@
 }
 
 \arguments{
-  \item{x}{ Vector of trait data (in phylo\$tip.label order) }
+  \item{x}{ Vector or data.frame of trait data (in phylo\$tip.label order) }
   \item{phy}{ phylo object }
 }
 

Modified: pkg/man/phylosignal.Rd
===================================================================
--- pkg/man/phylosignal.Rd	2008-03-02 22:52:00 UTC (rev 34)
+++ pkg/man/phylosignal.Rd	2008-03-02 23:06:54 UTC (rev 35)
@@ -6,19 +6,19 @@
   Calculates K statistic of phylogenetic signal as well as P-value based on variance of phylogenetically independent contrasts relative to tip shuffling randomization.
 }
 \usage{
-phylosignal(x, phy, reps = 999)
+phylosignal(x, phy, reps = 999, ...)
 }
 %- maybe also 'usage' for other objects documented here.
 \arguments{
   \item{x}{ Trait vector (same order as phy\$tip.label) }
   \item{phy}{ phylo object }
   \item{reps}{ Number of randomizations }
+  \item{reps}{ Additional arguments passed to pic }
 }
 \value{
  Data frame with columns...
-  \item{K }{Description of `comp1'}
-  \item{PIC.variance.obs }{Mean observed PIC variance}
-  \item{PIC.variance.random }{Mean random PIC variance}
+  \item{K }{K statistic}
+  \item{PIC.variance }{Mean observed PIC variance}
   \item{PIC.variance.P }{P-value of observed vs. random variance of PICs}
    \item{PIC.variance.z }{Z-score of observed vs. random variance of PICs}
 }



More information about the Picante-commits mailing list