Learn R Programming

geiger (version 1.2-13)

geiger-package: GEIGER

Description

A package for macroevolutionary simulation and estimating parameters related to diversification from comparative phylogenetic data.

Arguments

Details

ll{ Package: geiger Type: Package Version: 1.0 Date: 2007-01-19 License: GPL version 2 or greater? }

Examples

Run this code
# Disparity-through-time, as in Harmon et al. 2003
data(geospiza)
attach(geospiza)

dtt.full(geospiza.tree, geospiza.data)


# Simulation tester - verifies that simulations produce expected vcv structure
sims<-sim.char(geospiza.tree, as.matrix(1.0), n=100000)
m<-var(t(sims[,1,]))
m2<-vcv.phylo(geospiza.tree)
round(m-m2)
# Equal to zero because the vcv matrices are as expected.

#Test models of evolution
fitContinuous(geospiza.tree, geospiza.data)


# Reconstruct evolutionary vcv matrix
v<-cbind(c(4.0, -1.5),c(-1.5, 9.0))
n<-1000
sims<-sim.char(geospiza.tree, v, n)
r<-array(dim=c(2, 2, n))
for(i in 1:n)
	r[,,i]<-ic.sigma(geospiza.tree, sims[,,i])
v.recon<-apply(r, c(1,2), mean)
v-v.recon

# Discrete character evolution
q<-list(rbind(c(-.01, .01), c(.01, -.01)))
sims<-sim.char(geospiza.tree, q, model="discrete", n=100)

Run the code above in your browser using DataLab