
Get an unscaled rate of an event from a GeneralSubstitution object.
This method gets the element corresponding to a given event form the unscaled Q 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.
The rescaled rates (used during simulations) are returned by the getEventRate
method.
This method doesn't take into account the site specific rate multipliers in any way.
# S3 method for GeneralSubstitution
getRate(this, name=NA, from=NA, to=NA, ...)
A GeneralSubstitution object.
The name of the event.
The initial state.
Target state.
Not used.
A Numeric vector of length one.
For more information see GeneralSubstitution
.
# 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 unscaled rate of "0->1" by name
getRate(p,"0->1")
# get the unscaled rate of "0->1" by states
getRate(p,from="0",to="1")
# }
Run the code above in your browser using DataLab