Learn R Programming

phylosim (version 3.0.5)

hasSymbols.Alphabet: Check if an Alphabet object has a given set of symbols

Description

Check if an Alphabet object has a given set of symbols. Returns true if the class of the object is "AnyAlphabet".

Usage

# S3 method for Alphabet
hasSymbols(this, sym, ...)

Arguments

this

An Alphabet object.

sym

A character vector.

...

Not used.

Value

TRUE or FALSE

See Also

For more information see Alphabet.

Examples

Run this code
# NOT RUN {
	# create alphabet object
	a<-Alphabet(symbols=c("A","T","G","C"));
	# check if it has the symbols "A" and "G"
	hasSymbols(a,c("A","G"))
	# check if has the symbol "X"
	hasSymbols(a,"X")
	# any alphabet returns true for every symbol
	b<-AnyAlphabet();
	hasSymbols(b,"X")

 
# }

Run the code above in your browser using DataLab