Learn R Programming

phylosim (version 3.0.5)

getEventsAtSite.ToleranceSubstitution: Generate the list of active Event objects for a given attached Site object

Description

Generate the list of active Event objects for a given attached Site object.

This is the single most important method in the ToleranceSubstitution class. It generates a list of the active Event objects given the transition rate matrix (Q matrix) and the "rate.multiplier" Site-Process specific parameter. It returns an empty list if the state of the site is "NA".

Usage

# S3 method for ToleranceSubstitution
getEventsAtSite(this, target.site, ...)

Arguments

this

A ToleranceSubstitution object.

target.site

A Site object. The ToleranceSubstitution object must be attached to the Site object.

...

Not used.

Value

A list of the active Event objects.

See Also

For more information see ToleranceSubstitution.

Examples

Run this code
# NOT RUN {
	# create an Alphabet object
	a<-BinaryAlphabet()
	# create a Site object
	s<-Site(alphabet=a);
	# create a ToleranceSubstitution object
	p<-ToleranceSubstitution(alphabet=a,rate.list=list("0->1"=1,"1->0"=1))
	# attach process p to site object s
	attachProcess(s,p)
	# get the rate of active events
	getEventsAtSite(p,s)	# empty list
	# set the state of s
	s$state<-1;
	# get the rate of active events
	getEventsAtSite(p,s)
 
# }

Run the code above in your browser using DataLab