Description Arguments Value Examples
Compute the n-grams (contiguous sub-sequences of length n) of a given sequence.
x |
a sequence (vector). |
n |
a positive integer giving the length of contiguous sub-sequences to be computed. |
a list with the computed sub-sequences.
1 2 3 4 5 6 7 |
[[1]]
[1] "The" "quick" "brown"
[[2]]
[1] "quick" "brown" "fox"
[[3]]
[1] "brown" "fox" "jumps"
[[4]]
[1] "fox" "jumps" "over"
[[5]]
[1] "jumps" "over" "the"
[[6]]
[1] "over" "the" "lazy"
[[7]]
[1] "the" "lazy" "dog"
[1] "The quick brown" "quick brown fox" "brown fox jumps" "fox jumps over"
[5] "jumps over the" "over the lazy" "the lazy dog"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.