Learn R Programming

phylosim (version 3.0.5)

setProcesses.Site: Specify the list of Process objects attached to a Site object

Description

Specify the list of Process objects attached to a Site object. The Process objects in the "value" list correspond to the set of processes to be attached to the Site object. Process objects already attached to a given Site are skipped. Attached processes which are not memebers of the list are detached, so specifying an empty list will detach all processes.

This method is an alternative to attachProcess.Site and detachProcess.Site, working with more than one process object.

Usage

# S3 method for Site
setProcesses(this, value, ...)

Arguments

this

A Site object.

value

A list of valid Process objects.

...

Not used.

Value

The Site object (invisible).

See Also

For more information see Site.

Examples

Run this code
# NOT RUN {
	# create a Site object
	s<-Site(alphabet=NucleotideAlphabet())
	# create some processes
	p1<-JC69(); p2<-K80(); p3<-DiscreteInsertor(rate=1);
	# attach the processes
	setProcesses(s,list(p1,p2,p3))
	# attach one more process via virtual field
	s$processes<-c(s$processes,list(GTR()))
	# get the list of attached processes
	s$processes
	# detach all processes via virtual field
	s$processes<-list()
	s$processes
 
# }

Run the code above in your browser using DataLab