write_all_omx: Write all matrix cores to an OMX file

View source: R/read_write_omx.R

write_all_omxR Documentation

Write all matrix cores to an OMX file

Description

Write all matrix cores to an OMX file

Usage

write_all_omx(object, file, long = TRUE)

Arguments

object

The object to be written to OMX. May be either a tibble or a list of named matrices.

file

The location of the OMX file.

long

Identify whether the object to be written is a long-format 'tibble' (the default, 'TRUE') or a list of named matrices.

Value

List of write function return codes; 0 if successful.

Examples

omxfile <- omxr_example("skims.omx")
# long-format (tibble)
skims <- read_all_omx(omxfile, names = c("DIST", "DISTBIKE", "DISTWALK"))
write_all_omx(skims, file = tempfile(fileext = ".omx"))

# list of matrices
skims <- read_all_omx(omxfile, names = c("DIST", "DISTBIKE", "DISTWALK"), long = FALSE)
write_all_omx(skims, file = tempfile(fileext = ".omx"), long = FALSE)


gregmacfarlane/omxr documentation built on May 7, 2022, 11:42 a.m.