Learn R Programming

pcrcoal (version 1.2.0)

sample.tree: Sample a coalescent tree according to a PCR experiment

Description

This method returns a coalescent tree sampled according to the PCR experiment specified by the parameters stored in the slots of the PCRcoal object given as the first argument. All of the slots must contain a defined value.

Use this method if you are interested only in the sampled tree.

Usage

"sample.tree"(object)

Arguments

object
A PCRcoal object, with all the slots defined.

Value

An ape phylo object (rooted).

See Also

The PCRcoal class. The sample.tnt and sample.trs methods.

Examples

Run this code
	# Construct a PCRcoal object 
	# and specify the experimental conditions:
	sim <-PCRcoal(
        initial.size    =5,
        sample.size     =10,
        nr.cycles       =30,
        efficiencies    =c(rep(0.1, 30))
    	)

	# Sample a coalescent tree:
	tree <- sample.tree(sim)

	# Print tree info:
	print(tree)

	# Plot the tree:
	plot(tree)
	

Run the code above in your browser using DataLab