R/sampling.rate.R

sampling.rate<-function(x, startmsec=NULL, endmsec=NULL){
  
  if (is.null(startmsec)|is.null(endmsec)){
    stop("startmsec and endmsec must be specified", call.=F)
  }
  
  #### simple function to calculate sampling rate (in Hz) from object normally used in erpR package
	samp.rate=((dim(x)[1]-1)*1000)/(-startmsec+endmsec)
	return(samp.rate)
}

Try the erpR package in your browser

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

erpR documentation built on June 7, 2019, 3 a.m.