View source: R/generate_hash.R
generate_hash | R Documentation |
This function generates a hash value for a given list of arguments. It is designed to produce a consistent hash by optionally removing NA values, ordering arguments alphabetically, handling timestamp inclusion, etc.
generate_hash(
parameters_list,
hash_includes_timestamp = FALSE,
ignore_na = TRUE,
alphabetical_order = TRUE,
algo = "xxhash64",
ignore_script_name = FALSE
)
parameters_list |
A named list of arguments for which the hash will be generated. Each element in the list should correspond to a parameter. |
hash_includes_timestamp |
Logical; if FALSE, any timestamp included in parameters_list will be removed before hash generation. If TRUE, the timestamp will be included in the hash calculation. |
ignore_na |
Logical; if TRUE, any NA values in parameters_list will be removed before hash generation. |
alphabetical_order |
Logical; if TRUE, the arguments in parameters_list will be sorted alphabetically by their names before hash generation. |
algo |
The hash algorithm to use (See |
ignore_script_name |
Logical. If |
A character string representing the hash value of the provided argument list.
args <- list(param1 = "value1", param2 = 100, param3 = NA)
generate_hash(args)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.