Learn R Programming

phylosim (version 3.0.5)

getQMatrix.GeneralSubstitution: Get the QMatrix object aggregated by a GeneralSubstitution object

Description

Get the QMatrix object aggregated by a GeneralSubstitution object.

This method is mostly used internally.

Usage

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

Arguments

this

A GeneralSubstitution object.

...

Not used.

Value

A QMatrix object.

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 the QMatrix object
	getQMatrix(p)
	# get the QMatrix object via virtual field
	q<-p$qMatrix
	# tweak with the QMatrix
	setRate(q,"0->1",2)
	# set a new QMatrix for p
	setQMatrix(p,q)
	summary(p)
	# set new QMatrix via virtual field
	setRate(q,"1->0",2)
	p$qMatrix<-q
	summary(p)
 
# }

Run the code above in your browser using DataLab