Learn R Programming

phylosim (version 3.0.5)

getAlphabets.Sequence: Get the list of the Alphabet objects attached to the Site objects aggregated by a Sequence object

Description

Get the list of the Alphabet objects attached to the Site objects aggregated by a Sequence object.

Usage

# S3 method for Sequence
getAlphabets(this, index, ...)

Arguments

this

A Sequence object.

index

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

...

Not used.

Value

A list of Alphabet objects.

See Also

For more information see Sequence.

Examples

Run this code
# NOT RUN {
	# create a Sequence object with NucleotideAlphabet
	#and BinaryAlphabet objects attached
	s<-Sequence(alphabets=list(NucleotideAlphabet(),BinaryAlphabet()),length=5)
	setStates(s,c("A","0"))
	# get the list of attached Alphabet objects
	getAlphabets(s)
	# get Alphabets from a range
	getAlphabets(s,c(2:3,5))
	# get alphabets via virtual field
	s$alphabets
 
# }

Run the code above in your browser using DataLab