Learn R Programming

phylosim (version 3.0.5)

getEventRate.ToleranceSubstitution: Get the scaled rate of an event from a ToleranceSubstitution object

Description

Get the scaled rate of an event from a ToleranceSubstitution object.

This method return the element from the scaled rate matrix stored in the associated QMatrix object corresponding to a given event. The event can be specified by the inital and target states ("from" and "to" arguments), or by the event name ("from->to"). The event name takes precedence over the "from" and "to" arguments.

This method doesn't take into account the site specific rate multipliers in any way.

Usage

# S3 method for ToleranceSubstitution
getEventRate(this, name=NA, from=NA, to=NA, ...)

Arguments

this

A ToleranceSubstitution object.

name

The name of the event.

from

The initial state.

to

Target state.

...

Not used.

Value

A Numeric vector of length one.

See Also

For more information see ToleranceSubstitution.

Examples

Run this code
# NOT RUN {
	# create a ToleranceSubstitution object
	# provide an Alphabet object and the rates
	p<-ToleranceSubstitution(alphabet=BinaryAlphabet(), rate.list=list("1->0"=1,"0->1"=1))
	# get the scaled rate of "0->1" by name
	getEventRate(p,"0->1")
	# get the scaled rate of "0->1" by states
	getEventRate(p,from="0",to="1")
 
# }

Run the code above in your browser using DataLab