R/check.R

Defines functions check

check <- function(Data, Group, ncomp, Scale) {
  
 
  Group = as.factor(Group)

  if(!is.data.frame(Data) & !is.matrix(Data))
    stop("\nOops the class of Data must be data.frame or matrix")
  
  # if(has_missing(Data))
  if(sum(is.na(Data)) != 0)
    stop("Oops there are missing values")
  
  
  if(nrow(Data) != length(Group))
    stop("\nOops the length of group is different of number of rows in data")
  
  
  if(length(levels(Group)) == 1)
    stop("\nGroups must have more than one level") 
  
  TRUE
}

Try the multigroup package in your browser

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

multigroup documentation built on March 26, 2020, 5:50 p.m.