R: Load Hashmaps

load_hashmap {hashmap} | R Documentation

## Load Hashmaps

### Description

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

### Usage

    load_hashmap(file)

### 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

    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)
    )

[Package hashmap version 0.2.2 Index]