Description Usage Arguments Details Value See Also Examples
save_hashmap
writes a Hashmap
's data to the
specified file, which can be passed to load_hashmap
at a
later point in time to recreate the object.
1 | save_hashmap(x, file, overwrite = TRUE, compress = FALSE)
|
x |
an object created by a call to |
file |
a filename where the object's data will be saved. |
overwrite |
if |
compress |
a logical value or the type of file compression to use;
defaults to |
Saving is done by calling base::saveRDS
on the object's
data.frame
representation, x$data.frame()
. Attempting to
save an empty Hashmap
results in an error.
Nothing on success; an error on failure.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | H <- hashmap(sample(letters[1:10]), sample(1:10))
tf <- tempfile()
save_hashmap(H, tf)
inherits(
try(save_hashmap(H, tf, FALSE), silent = TRUE),
"try-error"
)
H$insert("zzzzz", 123L)
save_hashmap(H, tf)
load_hashmap(tf)
|
[1] TRUE
## (character) => (integer)
## [e] => [2]
## [h] => [8]
## [c] => [4]
## [f] => [3]
## [b] => [1]
## [d] => [6]
## [...] => [...]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.