[Picante-commits] r222 - in pkg: data man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Apr 9 01:19:44 CEST 2010


Author: skembel
Date: 2010-04-09 01:19:43 +0200 (Fri, 09 Apr 2010)
New Revision: 222

Added:
   pkg/data/IvesGodfray.rda
   pkg/man/IvesGodfray.Rd
Modified:
   pkg/man/pblm.Rd
   pkg/man/specaccum.psr.Rd
Log:
Add Ives & Godfray data set, examples for pblm and specaccum.psr

Added: pkg/data/IvesGodfray.rda
===================================================================
(Binary files differ)


Property changes on: pkg/data/IvesGodfray.rda
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: pkg/man/IvesGodfray.Rd
===================================================================
--- pkg/man/IvesGodfray.Rd	                        (rev 0)
+++ pkg/man/IvesGodfray.Rd	2010-04-08 23:19:43 UTC (rev 222)
@@ -0,0 +1,24 @@
+\name{IvesGodfray}
+\alias{IvesGodfray}
+\docType{data}
+\title{ Host-parasitoid food web data }
+\description{
+  Data on the structure of a host-parasitoid food web from Ives & Godfray (2006). Includes information on phylogenetic covariances among 12 leaf-mining moth hosts and 27 species of parasitoid wasps.
+}
+\usage{data(phylocom)}
+\format{
+    A list with three elements:
+    \itemize{
+      \item{ host }{ Phylogenetic variance/covariance matrix for 12 leaf-mining moth hosts }
+      \item{ parasitoid }{ Phylogenetic variance/covariance matrix for 27 species of parasitoid wasps }
+      \item{ interactions }{ Matrix describing interactions between hosts and parasitoids }
+      }
+}
+
+\source{
+Ives A.R. & Godfray H.C. (2006) Phylogenetic analysis of trophic associations. The American Naturalist, 168, E1-E14
+}
+
+\seealso{ \code{\link{pblm}} }
+
+\keyword{datasets}

Modified: pkg/man/pblm.Rd
===================================================================
--- pkg/man/pblm.Rd	2010-04-08 22:32:20 UTC (rev 221)
+++ pkg/man/pblm.Rd	2010-04-08 23:19:43 UTC (rev 222)
@@ -74,5 +74,35 @@
 }
 
 \author{ Matthew Helmus \email{mrhelmus at gmail.com} }
+\examples{
+#load example data from Ives & Godfray (2006)
+data(IvesGodfray)
 
+#net attack rate of parasitoid on host eq.4 in Ives and Godfray
+A<-(-1*log(1-IvesGodfray$interactions[,-28]/t(IvesGodfray$interactions[28])))
+
+# Make tips of the phylogenetic trees contemporaneous by extending tips
+p<-dim(IvesGodfray$host)[1]
+q<-dim(IvesGodfray$parasitoid)[1]
+host.cov.scaled<-IvesGodfray$host
+para.cov.scaled<-IvesGodfray$parasitoid
+for (i in 1:p)
+{
+  host.cov.scaled[i,i]<-max(host.cov.scaled)
+}
+for (i in 1:q)
+{
+  para.cov.scaled[i,i]<-max(para.cov.scaled)
+}
+
+# scale covariance matrices (this reduces numerical problems caused by
+# determinants going to infinity or zero)
+  host.cov.scaled<-host.cov.scaled/(det(as.matrix(host.cov.scaled))^(1/p))
+  para.cov.scaled<-para.cov.scaled/(det(as.matrix(para.cov.scaled))^(1/q))
+
+pblm.A <- pblm(sqrt(A),tree1=host.cov.scaled,tree2=para.cov.scaled)
+pblm.A$signal.strength    #compare to Ives and Godfray (2006) Table 1 Line 1
+pblm.A$MSE
+
+}
 \keyword{univar}
\ No newline at end of file

Modified: pkg/man/specaccum.psr.Rd
===================================================================
--- pkg/man/specaccum.psr.Rd	2010-04-08 22:32:20 UTC (rev 221)
+++ pkg/man/specaccum.psr.Rd	2010-04-08 23:19:43 UTC (rev 222)
@@ -32,6 +32,17 @@
               \cr Helmus M.R., Bland T.J., Williams C.K. & Ives A.R. (2007) Phylogenetic measures of biodiversity. American Naturalist, 169, E68-E83 }
 \author{ Matthew Helmus \email{mrhelmus at gmail.com} based on the \code{vegan} package \link[vegan]{specaccum} function by Roeland Kindt and Jari Oksanen. }
 \seealso{ \code{\link{psr}}, \code{\link[vegan]{specaccum}}}
+\examples{
+data(phylocom)
+accum.sr<-specaccum(phylocom$sample, permutations = 100, method = "random")
+plot(accum.sr, col="blue")
+points(accum.sr$sites, accum.sr$richness, pch=19, col="blue")
 
+accum.psr<-specaccum.psr(phylocom$sample, phylocom$phylo, permutations = 100, method = "random")
+plot(accum.psr, add=TRUE, col = "red")
+points(accum.psr$sites, accum.psr$richness, pch=19, col="red")
+
+legend(5,5,legend=c("SR","PSR"),pch=c(19,19),col=c("blue","red"))
+}
 \keyword{univar}
                                                                                                                  
\ No newline at end of file



More information about the Picante-commits mailing list