packPotts {potts} | R Documentation |
Transform Potts Model Data
Description
transform Potts model data from integer matrix to raw vector and vice versa.
Usage
packPotts(x, ncolor)
inspectPotts(raw)
unpackPotts(raw)
Arguments
x |
integer matrix containing Potts model data. Colors are coded
from one to |
ncolor |
integer scalar, number of colors. |
raw |
vector of type |
Value
for packPotts
a vector of type "raw"
.
for inspectPotts
a list containing components
ncolor
, nrow
, and ncol
.
for unpackPotts
an integer matrix.
Examples
x <- matrix(sample(4, 2 * 3, replace = TRUE), nrow = 2)
x
foo <- packPotts(x, ncolor = 4)
foo
inspectPotts(foo)
unpackPotts(foo)
[Package potts version 0.5-11 Index]