R/noba.R

Defines functions noba

Documented in noba

noba <-
function(x, batch) {

  if(any(is.na(x)))
	stop("Data contains missing values.")
  if(!(is.factor(batch)))
    stop("'batch' has to be of class 'factor'.")  
  if(!is.matrix(x))
    stop("'x' has to be of class 'matrix'.") 
  
  params <- list(xadj=x)
  params$nbatches <- length(unique(batch))
  params$batch <- batch  
  
  class(params) <- "noba"
   
  return(params)

}

Try the bapred package in your browser

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

bapred documentation built on June 22, 2022, 9:08 a.m.