Learn R Programming

phylosim (version 3.0.5)

setParameterAtSites.Sequence: Set the values of a site-process specific paramater for a process and a collection of Site objects aggregated by a Sequence object

Description

Set the values of a site-process specific paramater for a process and a collection of Site objects aggregated by a Sequence object.

Usage

# S3 method for Sequence
setParameterAtSites(this, process, id, value, index, ...)

Arguments

this

A Sequence object.

process

A valid Process object.

id

The identifier of the site-process specific parameter.

value

A vector containing the new values of the site-process specific parameter, recycled if shorter than the index vector. It should be consistent with the type of the parameter.

index

An integer vector specifying a set of positions. It is set to 1:seq$length if omitted.

...

Not used.

Value

The Sequence object (invisible).

See Also

Site Process For more information see Sequence.

Examples

Run this code
# NOT RUN {
	# create a sequence, attach a process
	p<-K80()
	s<-Sequence(length=6,alphabets=list(NucleotideAlphabet()),processes=list(list(p)))
	# set a new pattern of rate multipliers in the range 1:3,
   # the default value is 1.0 by the way
	setParameterAtSites(s,p,"rate.multiplier",c(2,3),1:3)
	# get rate multipliers
	getParameterAtSites(s,p,"rate.multiplier")
	# set a new value for the whole sequence
	setParameterAtSites(s,p,"rate.multiplier",0.5)
	# get rate multipliers
	getParameterAtSites(s,p,"rate.multiplier")
 
# }

Run the code above in your browser using DataLab