checkRange             package:ifultools             R Documentation

_C_h_e_c_k _t_h_e _r_a_n_g_e _o_f _a _n_u_m_e_r_i_c _o_b_j_e_c_t

_D_e_s_c_r_i_p_t_i_o_n:

     Tests the input range based on the specified interval.

_U_s_a_g_e:

     checkRange(x, range.=0:1, inclusion=c(TRUE,TRUE))

_A_r_g_u_m_e_n_t_s:

       x: an object belonging to class numeric.

inclusion: a two-element logical vector defining the boundary tests.
          For example, if 'range.=0:1', the interval boundaries are
          tested as follows

          _i_n_c_l_u_s_i_o_n=_c(_T_R_U_E,_T_R_U_E) range(x) must be on [0,1].

          _i_n_c_l_u_s_i_o_n=_c(_T_R_U_E,_F_A_L_S_E) range(x) must be on [0,1).

          _i_n_c_l_u_s_i_o_n=_c(_F_A_L_S_E,_T_R_U_E) range(x) must be on (0,1].

          _i_n_c_l_u_s_i_o_n=_c(_F_A_L_S_E,_F_A_L_S_E) range(x) must be on (0,1).

          If only a single logical element is specified, it is
          replicated to form a two-element vector. If more than two
          elements are specified, only the first two are used as
          described above. Default: 'c(TRUE,TRUE)'.

  range.: a two-element numeric vector containing the limits of the
          test interval. Default: '0:1'.

_V_a_l_u_e:

     no output is returned. If these tests fail, a 'stop' condition is
     executed.

_S_e_e _A_l_s_o:

     'isVectorAtomic', 'checkVectorType', 'checkScalarType'.

_E_x_a_m_p_l_e_s:

     ## expect no output from the following calls 
     checkRange(pi,range=c(0,5))
     checkRange(1:5,range=c(1,5), inclusion=c(TRUE,TRUE))

