R/shoreline_kernel.R

Defines functions shoreline_kernel

Documented in shoreline_kernel

shoreline_kernel<-function(x){
  kernell<-matrix(rep(-1,x*x),nrow=x)
  if ( x %% 2 == 0){
    y<-x/2
    idx<-matrix(c(y,y,y+1,y+1,y,y+1,y,y+1),ncol=2)
    kernell[idx]<-(x*x-4)/4
  }else{
    kernell[ceiling(x/2),ceiling(x/2)]<-x*x-1
  }
  kernell[kernell==0]<-1
  return(kernell)
}

Try the PCM package in your browser

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

PCM documentation built on May 2, 2019, 5:16 p.m.