Skip to contents

Makes a memory-mapped vector

Usage

mmap_make(path = NULL, data = NULL, type = NULL)

Arguments

path

Path to an existing file, or a file to write to if data is provided

data

A double or integer vector to write to path, or NULL to only read from it.

type

Either "double" or "integer", indicating the data type to read from disk. If not provided, it will be assumed to be the type of data.

Value

A memory mapped vector, using the contents of path

Examples

mmap_make(
  tempfile(),
  rnorm(n=5)
)
#> [1]  0.3735160  0.9206572 -0.4462072 -0.8976637  0.4869897