Skip to contents

make_dictionary() creates a dictionary for use with add_dictionary().

Usage

make_dictionary(definitions, name = NULL)

Arguments

definitions

A list of named word vectors

name

The kind of dictionary

Value

A data frame with two columns, "word" and

Examples

my_sentiments <- make_dictionary(
  list(
    "😊" = c("happy", "joy", "smile"),
    "😔" = c("unhappy", "sad", "frown")),
  name = "emoji")

border_states <- make_dictionary(
  definitions = list(
    "Canada" = c(
      "Alaska", "Washington", "Idaho",
      "Montana", "North_Dakota", "Minnesota",
      "Wisconsin", "Michigan", "Ohio",
      "Pennsylvania", "New_York", "Vermont",
      "New_Hampshire", "Maine", "AK", "WA",
      "ID", "MT", "ND", "MN", "WI", "MI",
      "OH", "PA", "NY", "VT", "NH", "ME"),
    "Mexico" = c(
      "California", "Arizona", "New_Mexico",
      "Texas", "CA", "AZ", "NM", "TX")),
  name = "borders")