Description Usage Arguments Examples
View source: R/compress_paths.R
Create Dictionary from Unique Strings
1 | to_dictionary(x, prefix = "a", leading_zeros = FALSE)
|
x |
vector of strings |
prefix |
prefix to be given to the keys in the dictionary. Default: "a" |
leading_zeros |
whether to make all keys in the dictionary have same
length by adding leading zeros to the keys. Default: |
1 2 3 4 5 6 7 8 | # Define input strings
x <- c("elephant", "mouse", "cat", "cat", "cat", "mouse", "cat", "cat")
# Create a dictionary for the unique values in x
kwb.pathdict:::to_dictionary(x)
# Note that "cat" is the first entry because it has the highest "importance"
kwb.pathdict:::sorted_importance(x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.