View source: R/read_write_omx.R
write_omx | R Documentation |
This function writes OMX matrix data. A full matrix can be written or just portions of an existing matrix. It allows overwriting existing matrix values, but only if the "Replace" argument is set to TRUE. If only portions of the matrix are to be written to, the full matrix must already exist.
write_omx( matrix, file, name, row_index = NULL, col_index = NULL, na_value = -1, replace = FALSE, description = "" )
matrix |
Matrix object to be stored. |
file |
Full path name of the OMX file to store the matrix in. If this is a new matrix file, see create_omx. |
name |
Name of the matrix in the OMX object. |
row_index |
An integer vector indicating the rows represented by
|
col_index |
The precise corrolary to |
na_value |
The value representing |
replace |
If the named object already exists in |
description |
(Optional) description of matrix contents. |
Write function return code; 0 if successful.
omxfile <- tempfile(fileext = ".omx") create_omx(omxfile, 10, 10) trips <- matrix(rnorm(n = 10^2, 200, 50), nrow = 10, ncol = 10) write_omx(matrix = trips, omxfile, "trips", description = "Total Trips")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.