R/Arimadiff.R

Defines functions Arimadiff

Documented in Arimadiff

Arimadiff <-
function(behavior,phaseX,v,d){
  t1<-table(phaseX)
  tmax<-t1[names(t1)==v]
  start<-match(v,phaseX)
  end<-tmax+start-1
  tsx<-behavior[start:end]
  e=length(tsx)
  x=1:end
  x<-ts(x,start=1,end=e,deltat=1)
  tsdiff<-diff(tsx,differences=d)
  
  
  par(mfrow=c(1,2))
  layout(rbind(1,2), heights=c(4,1))
  plot.ts(tsx,xlab="time", ylab="behavior")
  plot.ts(tsdiff,xlab="time", ylab="difference of behavior")
}

Try the SSDforR package in your browser

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

SSDforR documentation built on Nov. 24, 2023, 5:08 p.m.