Description Usage Arguments Examples
View source: R/generate_sequence.R
Generate a region using an alphabet of unigrams and considering provided set of rules.
1 | generate_single_region(alphabet, reg_len, prop_ranges, exactness)
|
alphabet |
the unigram alphabet. Columns are equivalent to unigrams and rows to particular properties. |
reg_len |
the number of unigrams inside the region. |
prop_ranges |
required intervals of properties of unigrams in the region. See Details. |
exactness |
a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | props1 <- list(P1 = c(0, 0.5),
P2 = c(0.2, 0.4),
P3 = c(0.5, 1),
P4 = c(0, 0))
props2 <- list(P1 = c(0.5, 1),
P2 = c(0.4, 1),
P3 = c(0, 0.5),
P4 = c(1, 1))
alph <- generate_unigrams(c(replicate(8, props1, simplify = FALSE),
replicate(12, props2, simplify = FALSE)),
unigram_names = letters[1L:20])
rules1 <- list(P1 = c(0.5, 1),
P2 = c(0.4, 1),
P3 = c(0, 0.5),
P4 = c(1, 1))
generate_single_region(alph, 10, rules1, 0.9)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.