R/xneig4.R

Defines functions xneig4

Documented in xneig4

xneig4=function(x,a,b,col){
n=dim(x)[1];m=dim(x)[2]
nei=c(x[a-1,b]==col,x[a,b-1]==col)
if (a!=n)
  nei=c(nei,x[a+1,b]==col)
if (b!=m) 
  nei=c(nei,x[a,b+1]==col)
sum(nei)
}

Try the bayess package in your browser

Any scripts or data that you put into this service are public.

bayess documentation built on Aug. 11, 2022, 5:07 p.m.