Description Usage Arguments Value Word types Author(s) Examples
Generates one or more sentences and asks user to rate them in the console.
Pass question, rating scale, and min/max rating labels.
Randomly create rating scales - either once or for each sentence.
Min/max rating labels can be passed as word types. Words are sampled
either once or once per sentence.
See Word types
below.
1 2 3 4 5 | rate_sentence(n = 1, question = "Was this sentence funny?", rscale = c(1,
10), max_rating = "Extremely", min_rating = "Not at all!",
change_label = FALSE, change_rscale = FALSE, rscale_limits = c(1, 1000),
simulate = FALSE, structures = NULL, word_lists = NULL,
int_structures = TRUE, int_word_lists = TRUE)
|
n |
Number of sentences to generate (Integer). |
question |
(Character) |
rscale |
Rating scale min and max. E.g. Pass |
max_rating |
Label for max rating value |
min_rating |
Label for min rating value |
change_label |
Whether to sample new word for labels, which have been passed as word types, on each run or only once (Logical). |
change_rscale |
Whether to create new random scale on each run or only once (Logical). |
rscale_limits |
Limits if generating random scale E.g. c(1,1000) |
simulate |
Simulate user ratings (Logical). |
structures |
Character Vector. E.g.:
Constrain the selection of words by specifying word info codes. E.g. only sample elements from the word list with max. 1 word in them, i.e. no white spaces:
Pass multiple word types - from which one is randomly selected:
See available See available |
word_lists |
List of word lists. A word list is named by the word type, e.g. verb. |
int_structures |
Use internal structures (Logical). |
int_word_lists |
Use internal word lists (Logical). |
Collected responses, sentences, rating labels and and the rating scale (Dataframe).
Word lists have been collected from the internet. They might contain words that seem out of place. Let me know and I'll remove them.
[superb] [positive_adj] [positive_vb] [positive_vb_past] [positive_adv]
[verb_base] [verb_past] [verb_past_participle] [verb_es] [verb_ing]
[noun] [noun_plural]
[salutation] [male_first_name] [female_first_name] [male_full_name] [female_full_name]
Notice: These are added as needed by author.
[create_syn] [small_syn] [big_syn]
[nationality_adj] [nationality_people]
[statistics_tradition]
Ludvig Renbo Olsen, r-pkgs@ludvigolsen.dk
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # Attach package
library(bhappyr)
# Notice: The argument 'simulate' is set to TRUE
# as the function is elsewise interactive, i.e.
# it is waiting for user input.
# Remove or set to FALSE when running as experiment!
# Example 1
# Generate 1 sentence and rate it.
rate_sentence(n=1, simulate = TRUE)
# Example 2
# Generate 3 sentences and rate them.
# Use random scale on each run.
rate_sentence(n=3, rscale = 'random',
change_rscale = TRUE,
simulate = TRUE)
# Example 3
# Generate 3 sentences and rate them.
# Use random max_rating label on each run.
rate_sentence(n=3, max_rating = "[superb(upper)]",
change_label = TRUE,
simulate = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.