discrete                package:Hmisc                R Documentation

_D_i_s_c_r_e_t_e _V_e_c_t_o_r _t_o_o_l_s

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

     'discrete' creates a discrete vector which is distinct from a
     continuous vector, or a factor/ordered vector. The other function
     are tools for manipulating descrete vectors.

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

     as.discrete(x, ...)
     ## Default S3 method:
     as.discrete(x, ...)
     discrete(x, levels = sort(unique.default(x), na.last = TRUE), exclude = NA)
     ## S3 replacement method for class 'discrete':
     x[...] <- value
     ## S3 method for class 'discrete':
     x[..., drop = FALSE]
     ## S3 method for class 'discrete':
     x[[i]]
     is.discrete(x)
     ## S3 replacement method for class 'discrete':
     is.na(x) <- value
     ## S3 replacement method for class 'discrete':
     length(x) <- value

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

       x: a vector 

    drop: Should unused levels be dropped. 

 exclude: logical: should 'NA' be excluded. 

       i: indexing vector 

  levels: charater: list of individual level values 

   value: index of elements to set to 'NA' 

     ...: arguments to be passed to other functions 

_D_e_t_a_i_l_s:

     'as.discrete' converts a vector into a discrete vector.

     'discrete' creates a discrete vector from provided values.

     'is.discrete' tests to see if the vector is a discrete vector.

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

     'as.discrete', 'discrete' returns a vector of 'discrete' type.

     'is.discrete' returan logical 'TRUE' if the vector is of class
     discrete other wise it returns 'FALSE'.

_A_u_t_h_o_r(_s):

     Charles Dupont

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

     '[[', '[', 'factor'

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

     a <- discrete(1:25)
     a

     is.discrete(a)

     b <- as.discrete(2:4)
     b

