knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
library(omxr)

omxr

CRAN status Build Status

The goal of omxr is to provide a convenient API for R users working with Open Matrix (OMX) format files. For more details on the file standard, see the osPlanning wiki.

Installation

We hope to have omxr on CRAN in the near future. Until then, you can install omxr with the devtools package

devtools::install_github("gregmacfarlane/omxr")

Example

With omxr you can examine the contents of existing OMX files within R.

# path to the omx file
omx_file <- omxr_example("skims.omx")

# list contents
list_omx(omx_file)

You can choose to read the matrix as either an R matrix or as a tidyverse-friendly tibble, depending on your needs.

m <- read_omx(omx_file, "DIST") # return an array
m[1:5, 1:5]

read_all_omx(omx_file, c("DIST", "DISTBIKE", "DISTWALK"))

More detailed examples, including creating and writing to OMX files, are available in the package vignette.

vignette(omxr)


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