Description Usage Arguments Details Value Warning See Also Examples
Get the digest (a xxHash64 hash of the dependencies and provider) of a module.
1 | get_digest(name = .Last.name, load = FALSE)
|
name |
A string (character vector of lenght one). A module name can contain letters, figures and some special characters,
namely Names containing The name "modulr" corresponds to a special module and is therefore reserved. |
load |
A flag. Should an undefined module be implicitely loaded? |
A digest is useful for comparing two modules. For instance, in order to know if a module definition has changed, a digest of the newly presented module is computed and compared to the existing one. When a module is imported from an URL, it is also possible to specify a digest. The imported module is then rejected if its digest differs from the expected value.
A string containing the digest of the module.
It is considered a very bad practice to define, touch, undefine, load, make, reset, or perform any other operation from within a module definition that may alterate the internal state of modulr.
define
and root_config
.
1 2 3 4 5 6 7 8 9 10 11 12 13 | reset()
define("foo", NULL, function() NULL)
get_digest("foo")
reset()
tmp_dir <- tempfile("modulr_")
dir.create(tmp_dir)
tmp_file <- file.path(tmp_dir, "foo.R")
cat('define("foo", NULL, function() NULL)', file = tmp_file)
root_config$set(tmp_dir)
## Not run: get_digest("foo", load = FALSE)
get_digest("foo", load = TRUE)
unlink(tmp_dir, recursive = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.