write_lookup | R Documentation |
This function writes a lookup vector to the file. It allows the user to specify if the lookup vector applies only to rows or columns (in case the matrix is not square and/or the rows and columns don't have the same meanings.
write_lookup( file, lookup_v, name, lookup_dim = NULL, replace = FALSE, description = "" )
file |
Full path name of the OMX file to store the lookup. |
lookup_v |
Vector containing the lookup information. Should be the same
length as the matrix dimension it maps to (see |
name |
Name for the lookup vector in |
lookup_dim |
Matrix dimension that the lookup vector is associated with
Values can be "row", "col", or NULL, meaning that the lookup is
two-dimensional. Defaults to |
replace |
Overwrite the existing lookup (if any)? Defaults to
|
description |
String defining the lookup. |
None
# create a test file omxfile <- tempfile(fileext = ".omx") create_omx(omxfile, 25, 25) EI <- c(rep("Int", 21), rep("Ext", 4)) D <- rep(1:5, each = 5) write_lookup(omxfile, EI, "EI", description = "External and Internal Zones") write_lookup(omxfile, D, "Districts", description = "Districts")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.