selectBonds: Function to select bonds based on colors and parameters

Description Usage Arguments Examples

View source: R/RcppExports.R

Description

Function to select bonds based on colors and parameters

Usage

1
selectBonds(Bds, Cols, Betas)

Arguments

Bds

matrix of neighbouring bonds.

Cols

vector of colors per vertex.

Betas

vector of parameters for the Potts model.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
Obs.loc = expand.grid(1:10,1:10)
Bds = getBonds(Obs.loc)
Bds = Bds[which(Bds[,1]>0),]
Betas = c(0.8, 0.8, 0.2)
Cols = sample(1:3, 100, replace = TRUE)
Bd = selectBonds(Bds, Cols, Betas)
par(mfrow = c(1,1))
col = grey.colors(3)
image(matrix(Cols, ncol = 10), col = col)
segments((Obs.loc[Bd[,1],1]-1)/9, (Obs.loc[Bd[,1],2]-1)/9, (Obs.loc[Bd[,2],1]-1)/9, (Obs.loc[Bd[,2],2]-1)/9)
segments((Obs.loc[,1]-1)/9, (Obs.loc[,2]-1)/9, (Obs.loc[,1]-1)/9, (Obs.loc[,2]-1)/9, lwd = 4)

ick003/SpTMixture documentation built on May 18, 2019, 2:32 a.m.