packPotts: Transform Potts Model Data

Description Usage Arguments Value Examples

View source: R/packPotts.R

Description

transform Potts model data from integer matrix to raw vector and vice versa.

Usage

1
2
3

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

1
2
3
4
5
6
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 March 23, 2020, 5:07 p.m.