R/Is.Numeric.R

Defines functions Is.Numeric

Documented in Is.Numeric

##########################################################################
# These functions are
# Copyright (C) 2014-2020 V. Miranda & T. Yee
# Auckland University of Technology & University of Auckland
# All rights reserved.


Is.Numeric <- function(x, isInteger  = FALSE, 
                       length.arg = NULL, 
                       Nnegative  = NULL)  {
  
  if ( all( is.numeric(x) )  &&
       ( if ( isInteger ) all( x%%1 == 0 )  else TRUE )   &&
       ( if ( length( length.arg ) ) 
         (length(x) == length.arg )  else TRUE )  &&
       ( if ( length(Nnegative) && is.logical(Nnegative) ) 
         if (Nnegative) all(x >= 0)  else all(x < 0) else TRUE)) 
    TRUE else FALSE
}
    

Try the VGAMextra package in your browser

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

VGAMextra documentation built on Nov. 2, 2023, 5:59 p.m.