Description Usage Arguments Value Examples
View source: R/use_dictionary.R
Substitute Values that are in a Dictionary with their Keys
1 | use_dictionary(x, dict, method = "full")
|
x |
vector of character |
dict |
list of key = value pairs. Values of this list that are found in
|
method |
method to be applied, must be one of "full" or "part".
If "full", the full values must match, otherwise the values in |
x
in which values or parts of the values are replaced with
their short forms as they are defined in the dictionary dict
1 2 3 4 5 6 7 8 9 10 | # Define a vector of long values
x <- c("What a nice day", "Have a nice day", "Good morning")
# Define short forms for full or partial values
dict_full <- list(wand = "What a nice day", gm = "Good morning")
dict_part <- list(w = "What", nd = "nice day", g = "Good")
# Replace long form values with their short forms
kwb.pathdict:::use_dictionary(x, dict_full, method = "full")
kwb.pathdict:::use_dictionary(x, dict_part, method = "part")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.