Learn R Programming

phylosim (version 3.0.5)

copySubSequence.Sequence: Copy a collection of Site objects aggregated by a Sequence object into a new Sequence object

Description

Copy a collection of Site objects aggregated by a Sequence object into a new Sequence object.

Usage

# S3 method for Sequence
copySubSequence(this, index, process=NA, ...)

Arguments

this

A Sequence object.

index

An index vector specifying a collection of sites to be copied. It is set to 1:seq$length if omitted.

process

The Process object performing the copy (optional).

...

Not used.

Value

A new Sequence object.

See Also

For more information see Sequence.

Examples

Run this code
# NOT RUN {
	# create a nucleotide sequence
	s<-NucleotideSequence(string="ATATATATATATATATA")
	# copy sites in the range 3:8 in a new object
	s2<-copySubSequence(s,3:8)
	s2
	# copy sites 1,3 and 5 from s2
	s3<-copySubSequence(s2,c(1,3,5))
	s3
 
# }

Run the code above in your browser using DataLab