Learn R Programming

phylosim (version 3.0.5)

setProposeBy.GeneralInDel: Set the function used for proposing indel lengths

Description

Set the function used for proposing indel lengths.

The function must return a numeric vector of length one. The function must have an argument named "process" which will hold the calling process object.

Usage

# S3 method for GeneralInDel
setProposeBy(this, value, ...)

Arguments

this

A GeneralInDel object.

value

A function object returning a numeric vector of length one.

...

Not used.

Value

The function object (invisible).

See Also

For more information see GeneralInDel.

Examples

Run this code
# NOT RUN {
	# create a GeneralInDel object
	# proposing events with a constant length of 5
	o<-GeneralInDel(rate=1, propose.by=function(process){return(5)});
	# set/get the proposeBy function
	setProposeBy(o,value=function(process){return(6)})
	getProposeBy(o)
	# set/get proposeBy function via virtual field
	o$proposeBy<-function(process){return(3)}
	o$proposeBy
 
# }

Run the code above in your browser using DataLab