Learn R Programming

phylosim (version 3.0.2)

setAncestral.Sequence: Set the ancestral object of a Sequence object

Description

Set the ancestral object of a Sequence object.

Usage

# S3 method for Sequence
setAncestral(this, value, ...)

Arguments

this

A Sequence object.

value

A Sequence or a Process object.

...

Not used.

Value

The new ancestral object (invisible).

See Also

For more information see Sequence.

Examples

Run this code
# NOT RUN {
	# create a nucleotide sequence and a process object
	s<-NucleotideSequence(string="AGCT")
	p<-Process(name="MyProcess")
	# set the p as the ancestral of s
	setAncestral(s,p)
	s$ancestral
	# clone s
	cs<-clone(s)
	# set cs as ancestral of s via virtual field
	s$ancestral<-cs
	# get ancestral ids
	s$ancestral$id
	cs$ancestral$id
 
# }

Run the code above in your browser using DataLab