Learn R Programming

TimeMachine (version 1.2.1)

time-dist: Time to Coalescent Event or Mutation

Description

Estimates the distribution of the times (expressed in SEN) between two coalescent events or two mutations.

Usage

# S3 method for tm
ttc(x)

# S3 method for tm ttm(x)

Arguments

x

An object of class tm as returned by a call to tm

Value

A vector representing the distribution of the time to coalescent event for ttc, or the time to mutation for ttm.

Examples

Run this code
# NOT RUN {
# Load example dataset
data(pdm)

transitions <- full.transitions(pdm$unitary.transitions, pdm$loci)
pi <- stationary.dist(transitions)
n <- 10
mu <- 1
samples <- 10
est.res <- tm(transitions, pi, pdm$population, n, mu, samples)

# Plot distributions of time to coalescent event and time to mutation
par(mfrow=c(1, 2))
plot(ttc(est.res), type="b", pch=20, lty=3, xlab="SEN", ylab="",
     main="Time to coalescent event")
plot(ttm(est.res), type="b", pch=20, lty=3, xlab="SEN", ylab="",
     main="Time to mutation")
# }

Run the code above in your browser using DataLab