Learn R Programming

phylosim (version 3.0.5)

sampleState.GeneralSubstitution: Sample a state from the equlibrium distribution of a GeneralSubstitution object

Description

Sample a state from the equlibrium distribution of a GeneralSubstitution object.

Usage

# S3 method for GeneralSubstitution
sampleState(this, ...)

Arguments

this

A GeneralSubstitution object.

...

Not used.

Value

A character vector of length one.

See Also

For more information see GeneralSubstitution.

Examples

Run this code
# NOT RUN {
	# create a GeneralSubstitution object
	# provide an Alphabet object and the rates
	p<-GeneralSubstitution(alphabet=BinaryAlphabet(), rate.list=list("1->0"=1,"0->1"=1))
	# get equlibrium distribution
	getEquDist(p)
	# get equilibrium distribution via virtual field
	p$equDist
	# sample from equilibrium distribution
	sampleState(p)
 
# }

Run the code above in your browser using DataLab