[Picante-commits] r37 - in pkg: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Mar 3 06:25:48 CET 2008


Author: skembel
Date: 2008-03-03 06:25:47 +0100 (Mon, 03 Mar 2008)
New Revision: 37

Added:
   pkg/corr.table.R
Removed:
   pkg/R/contrast.cor.P.R
   pkg/R/contrast.cor.table.R
   pkg/R/var.pic.R
   pkg/man/contrast.cor.P.Rd
   pkg/man/var.pic.Rd
Log:
Beginning cleanup and merge of related functions into combined files

Deleted: pkg/R/contrast.cor.P.R
===================================================================
--- pkg/R/contrast.cor.P.R	2008-03-02 23:24:49 UTC (rev 36)
+++ pkg/R/contrast.cor.P.R	2008-03-03 05:25:47 UTC (rev 37)
@@ -1,6 +0,0 @@
-`contrast.cor.P` <-
-function(r,df) {
-	t <- r * sqrt(df/(1-r^2))
-	dt(t,df)
-}
-

Deleted: pkg/R/contrast.cor.table.R
===================================================================
--- pkg/R/contrast.cor.table.R	2008-03-02 23:24:49 UTC (rev 36)
+++ pkg/R/contrast.cor.table.R	2008-03-03 05:25:47 UTC (rev 37)
@@ -1,9 +0,0 @@
-`contrast.cor.table` <-
-function(nodes,cor.method="pearson") {
-	concorr <- list()
-	concorr$r <- cor(reflect.contrasts(nodes),method=cor.method)
-	concorr$df <- length(nodes[,1])-1
-	concorr$P <- contrast.cor.P(concorr$r,concorr$df)
-	concorr
-}
-

Deleted: pkg/R/var.pic.R
===================================================================
--- pkg/R/var.pic.R	2008-03-02 23:24:49 UTC (rev 36)
+++ pkg/R/var.pic.R	2008-03-03 05:25:47 UTC (rev 37)
@@ -1,4 +0,0 @@
-`var.pic` <-
-function(x,phy,scaled=TRUE) {
-	var(pic(x,phy,scaled))
-}

Copied: pkg/corr.table.R (from rev 36, pkg/R/contrast.cor.table.R)
===================================================================
--- pkg/corr.table.R	                        (rev 0)
+++ pkg/corr.table.R	2008-03-03 05:25:47 UTC (rev 37)
@@ -0,0 +1,20 @@
+corr.table <- function (x, cor.method = "pearson", cor.type=c("standard","contrast")) 
+{
+    cor.type <- match.arg(cor.type)
+    if (identical(cor.type,"standard")) {
+        concorr <- list()
+        concorr$r <- cor(x, method = cor.method)
+        concorr$df <- dim(x)[1] - 2
+        t <- concorr$r * sqrt(concorr$df/(1 - concorr$r^2))
+        concorr$P <- dt(t, concorr$df)
+        concorr
+    }
+    else {
+    	concorr <- list()
+        concorr$r <- cor(reflect.contrasts(x),method=cor.method)
+        concorr$df <- length(x[,1])-1
+        t <- concorr$r * sqrt(concorr$df/(1-concorr$r^2))
+        concorr$P <- dt(t,concorr$df)
+        concorr
+    }
+}

Deleted: pkg/man/contrast.cor.P.Rd
===================================================================
--- pkg/man/contrast.cor.P.Rd	2008-03-02 23:24:49 UTC (rev 36)
+++ pkg/man/contrast.cor.P.Rd	2008-03-03 05:25:47 UTC (rev 37)
@@ -1,15 +0,0 @@
-\name{contrast.cor.P}
-\alias{contrast.cor.P}
-\title{P-value for PIC correlation with corrected df}
-\description{
-  P-value for PIC correlation with corrected df
-}
-\usage{
-contrast.cor.P(r, df)
-}
-\arguments{
-  \item{r}{ Correlation coefficient }
-  \item{df}{ Degrees of freedom }
-}
-\author{ Steve Kembel <skembel at berkeley.edu> }
-\keyword{univar}

Deleted: pkg/man/var.pic.Rd
===================================================================
--- pkg/man/var.pic.Rd	2008-03-02 23:24:49 UTC (rev 36)
+++ pkg/man/var.pic.Rd	2008-03-03 05:25:47 UTC (rev 37)
@@ -1,25 +0,0 @@
-\name{var.pic}
-\alias{var.pic}
-%- Also NEED an '\alias' for EACH other topic documented here.
-\title{ Variance of phylogenetically independent contrasts }
-\description{
-  Calculate variance of standardized phylogenetically independent contrast values
-}
-\usage{
-var.pic(x, phy, scaled = TRUE)
-}
-%- maybe also 'usage' for other objects documented here.
-\arguments{
-  \item{x}{ Vector of trait data sorted in phy\$tip.label order }
-  \item{phy}{ phylo object }
-  \item{scaled}{ TRUE or FALSE (PIC standardized or not) }
-}
-
-\value{
-  Variance of phylogenetically independent contrasts across all nodes
-}
-\references{ Blomberg and Garland. 2002. Evolution. }
-\author{ Steve Kembel <skembel at berkeley.edu> }
-
-\seealso{ \code{\link{phylosignal}}}
-\keyword{univar}



More information about the Picante-commits mailing list