View source: R/make_encoding_key.R
make_encoding_key | R Documentation |
Takes a vector of values and pairs them with prime numbers. The pairs can
then be used for encoding by encode_value()
, decoding by decode_value()
.
If there are several identical values in the input vector, only one prime
number per unique value is returned.
make_encoding_key(values_to_encode)
values_to_encode |
A vector containing all unique values to encode. |
A vector of prime numbers with names corresponding to the values to be encoded.
encode_value()
decode_value()
# Return a key of three prime numbers for three categories. prime_key <- make_encoding_key(c("Mammal", "Bird", "Fish"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.