Learn R Programming

phylosim (version 3.0.5)

getStates.Sequence: Get the states of a set of Site objects aggregated by a Sequence object

Description

Get the states of a set of Site objects aggregated by a Sequence object.

Usage

# S3 method for Sequence
getStates(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 character vector.

See Also

For more information see Sequence.

Examples

Run this code
# NOT RUN {
	# create a sequence object
	s<-Sequence(alphabets=list(NucleotideAlphabet()),string="AATTGCCCCCTTGG")
	# get all Site states
	getStates(s)
	# get the states for a collection of sites
	getStates(s,c(1:3,5,8))
	# get states via virtual field
	s$states
 
# }

Run the code above in your browser using DataLab