inst/shiny-squid/source/utilities/test_input_b_matrix.R

# test if the input is valid
testInputBMatrix  <- function(input, inputConf, errorOutput){ 
  
  validInput <- TRUE
  
  if(!is.numeric(input) || any(is.na(input))){
    validInput <- FALSE
  }else{
    if(inputConf$min != "") if(any(input < inputConf$min)) validInput <- FALSE
    if(inputConf$max != "") if(any(input > inputConf$max)) validInput <- FALSE
  }
  
  if(errorOutput){
   if(!validInput){
    return(error_msg(inputConf$errorTxt))
   }else{
     return(NULL)
   }
  }
  
  return(validInput)  
}

Try the squid package in your browser

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

squid documentation built on Jan. 22, 2022, 1:06 a.m.