Learn R Programming

phylosim (version 3.0.5)

flagTotalRate.Site: Flag the total event rate

Description

Flag the total event rate. This method sets the cached total active event rate to NA, which will trigger its recalculation when next accessed via getTotalRate.

Usage

# S3 method for Site
flagTotalRate(this, ...)

Arguments

this

A Site object.

...

Not used.

Value

Invisible NA.

See Also

For more information see Site.

Examples

Run this code
# NOT RUN {
	# create a site object:
	p<-K80(rate.params=list("Alpha"=2,"Beta"=0.5))
	s<-Site(alphabet=NucleotideAlphabet(), state="G", processes=list(p))
	# get site rate
	s$totalRate
	# modifying site object in a dangerous way (do not do this under any circumstances!)
	s$.processes = list()	# site object is now inconsistent!
	# get cached rate
	s$totalRate		# incorrect value
	# flag total rate
	flagTotalRate(s)
	# get site rate
	s$totalRate		# correct value

 
# }

Run the code above in your browser using DataLab