Learn R Programming

phylosim (version 3.0.5)

setAlphabet.GeneralSubstitution: Set the Alphabet object aggregated by a GeneralSubstitution object

Description

Set the Alphabet object aggregated by a GeneralSubstitution object.

This method also sets the alphabet for the associated QMatrix object, which will set all rates to NA. This method will also re-initialize the equlibrium distribution by setting all frequencies to NA.

Usage

# S3 method for GeneralSubstitution
setAlphabet(this, value, ...)

Arguments

this

A GeneralSubstitution object.

value

An Alphabet object.

...

Not used.

Value

The Alphabet object.

See Also

For more information see GeneralSubstitution.

Examples

Run this code
# NOT RUN {
	# create a GeneralSubstitution object with an attached BinaryAlphabet object
	p<-GeneralSubstitution(alphabet=BinaryAlphabet())
	# get object summary
	summary(p)
	# get alphabet
	getAlphabet(p)
	# get alphabet via virtual field
	p$alphabet
	# set a new alphabet
	setAlphabet(p,NucleotideAlphabet())
	summary(p)
	# set alphabet via virtual field
	p$alphabet<-BinaryAlphabet()
	p$alphabet
 
# }

Run the code above in your browser using DataLab