load_hashmap: Load Hashmaps

Description Usage Arguments Details Value See Also Examples

Description

load_hashmap reads a file created by a call to save_hashmap and returns a Hashmap object.

Usage

1

Arguments

file

the name of a file previously created by a call to save_hashmap.

Details

The object returned will contain all of the same key-value pairs that were present in the original Hashmap at the time save_hashmap was called, but they are not guaranteed to be in the same order, due to rehashing.

Value

A Hashmap object on success; an error on failure.

See Also

save_hashmap

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
H <- hashmap(sample(letters[1:10]), sample(1:10))
tf <- tempfile()

save_hashmap(H, tf)

H2 <- load_hashmap(tf)
all.equal(
    sort(H$find(H2$keys())),
    sort(H2$values())
)

all.equal(
    H$data.frame(),
    readRDS(tf)
)

hashmap documentation built on May 1, 2019, 10:13 p.m.