packPotts: Transform Potts Model Data

View source: R/packPotts.R

packPottsR 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.

ncolor

integer scalar, number of colors.

raw

vector of type "raw".

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)

potts documentation built on Aug. 12, 2022, 5:07 p.m.