View source: R/check_hash_existence.R
check_hash_existence | R Documentation |
This function checks for the existence of results saved under specified parameter list
in RDS files (saved with indexr
) within a given folder.
check_hash_existence(
folder,
parameters_list,
halt = FALSE,
hash_includes_timestamp = FALSE,
ignore_na = TRUE,
alphabetical_order = TRUE,
algo = "xxhash64",
ignore_script_name = FALSE
)
folder |
A string specifying the directory containing the RDS files. |
parameters_list |
A list of parameters for which a corresponding hash named file is checked. |
halt |
Logical; if TRUE, the function stops execution if an existing file is found. This may be useful as a check before running a simulation. |
hash_includes_timestamp |
Logical; if TRUE, timestamps are included in the hash generation process. |
ignore_na |
Logical; if TRUE, NA values are ignored during hash generation. |
alphabetical_order |
Logical; if TRUE, parameters are sorted alphabetically before hash generation. |
algo |
Character string specifying the hashing algorithm to use. Default is |
ignore_script_name |
Logical. If |
A logical of whether or not a file exists, unless halt = TRUE
and a file is found, then an error is thrown.
## Setup
tmp_dir <- file.path(tempdir(), "example")
dir.create(tmp_dir)
## Save an object
parameters_list <- list(example = "check_hash_existence")
save_objects(folder = tmp_dir, results = 1, parameters_list = parameters_list)
## Check that an object under specified parameters is saved
check_hash_existence(folder = tmp_dir, parameters_list)
## Cleanup
unlink(tmp_dir, recursive = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.