words {seqinr} | R Documentation

## 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.

### Author(s)

J.R. Lobry

### References

`citation("seqinr")`

### See Also

`kronecker`, `outer`

### Examples

    ## 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"))

[Package seqinr version 1.0-4 Index]