random_sent | R Documentation |
random_sent
- Generates a random sample of sentences (sentences are
sampled at the word level and there for are likely nonsensical).
random_data
- Generate random dialogue, people, and demographic
variables
random_sent(
n = 10,
len = 14,
range = len - 1,
dictionary = qdapDictionaries::Top200Words,
endmark.fun = function() sample(c(".", "!", "|", "?"), 1, prob = c(0.85, 0.05, 0.05,
0.05))
)
random_data(
n = 10,
...,
n.people = 10,
ages = 7:10,
people.names = unique(tolower(qdapDictionaries::NAMES[[1]]))
)
n |
Number of sentences to create. |
len |
Average length of sentences (in words). |
range |
Range around |
dictionary |
A dictionary of words to sample from. |
endmark.fun |
A function to create random end marks. |
n.people |
An integer of the number of people to include in the sample
(number of people is sampled from; if |
ages |
The possible ages to choose from (numeric). |
people.names |
A vector of names to choose from at least as large as
|
... |
Other arguments passed to |
random_sent
- Returns a random vector of sentence strings.
random_data
- Returns a data.frame
of
people, dialogue, and demographic variables of the class sent_split
.
## Not run:
random_sent()
random_sent(200, 10)
dict <- sort(unique(bag_o_words(pres_debates2012[["dialogue"]])))
random_sent(dictionary=dict)
random_data()
random_data(ages = seq(10, 20, by = .5))
random_data(50) %&% word_stats(person)
random_data(100) %&% word_stats(list(race, sex))
random_data(dictionary = dict)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.