R/convert.method.R

Defines functions convert.method

convert.method <- function(method){
  
  if(length(method) > 1){
    msg <- 'Invalid options$method'
    stop(msg)
  }
  
  if(is.numeric(method)){
    return(method)
  }
  
  valid.method <- c('ADAJOINT', 'ADAJOINT2', 'ARTP')
  method <- toupper(method)
  if(!(method %in% valid.method)){
    msg <- 'Invalid options$method'
    stop(msg)
  }
  
  method <- which(valid.method == method)
  method
  
}
zhangh12/ARTP2 documentation built on Aug. 16, 2019, 7:27 p.m.