seqinr (version 1.0-1)

words: To get all words from an alphabet.

Description

Generates a vectors of all the words from a given alphabet, with right positions varying faster, for instance if the alphabet is (c("0","1") and the length is 2 you will obtain c("00", "01", "10", "11")

Usage

words(length = 3, alphabet = s2c("acgt"))

Arguments

length
the number of characters in the words
alphabet
a vector of characters

Value

  • A vector of string whith length characters.

References

� To have an overview of the seqinR's functionnality, please consult this vignette: Charif, D., Lobry, J.R. (2005) SeqinR: a contributed package to the R project for statistical computing devoted to biological sequences retrieval and analysis. Springer Verlag, Biological and Medical Physics/Biomedical Series, in preparation.

See Also

kronecker, outer

Examples

Run this code
## Get all codons
words()
## Get all codons with a c g u for bases
words(alphabet = c("a", "c", "g", "u"))
## Get all tetranucleotides
words(length = 4)
## Get all dipeptides
words(length = 2, alphabet = s2c("ACDEFGHIKLMNPQRSTVWY"))

Run the code above in your browser using DataLab