getRate.QMatrix: Get an unscaled rate of an event from a QMatrix object

Description Usage Arguments Value See Also Examples

Description

Get an unscaled rate of an event from a QMatrix object.

This method gets the element corresponding to a given event form the unscaled rate matrix. 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.

Usage

1
2
## S3 method for class 'QMatrix'
getRate(this, name=NA, from=NA, to=NA, ...)

Arguments

this

A QMatrix 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 QMatrix.

Examples

1
2
3
4
5
6
7
8
       # create a QMatrix object
       # provide an Alphabet object and the rates
       m<-QMatrix(alphabet=BinaryAlphabet(), rate.list=list("1->0"=1,"0->1"=1))
       # get the unscaled rate of "0->1" by name
       getRate(m,"0->1")     
       # get the unscaled rate of "0->1" by states
       getRate(m,from="0",to="1")
 

phylosim documentation built on Nov. 22, 2019, 1:07 a.m.