Learn R Programming

seqinr (version 1.0-4)

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

citation("seqinr")

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