numeric                 package:base                 R Documentation

_N_u_m_e_r_i_c _V_e_c_t_o_r_s

_D_e_s_c_r_i_p_t_i_o_n:

     `numeric' creates a real vector of the specified length.  The
     elements of the vector are all equal to `0'.

     `as.numeric' attempts to coerce its argument to numeric type
     (either integer or real).

     `is.numeric' returns `TRUE' if its argument is of type real or
     type integer and `FALSE' otherwise.

_U_s_a_g_e:

     numeric(length = 0)
     as.numeric(x)
     is.numeric(x)

_N_o_t_e:

     R has no single precision data type.  All real numbers are stored
     in double precision format.

     `as.numeric' for factors yields the codes underlying the factor
     levels.

_E_x_a_m_p_l_e_s:

     as.numeric(c("-.1"," 2.7 ","B")) # (-0.1, 2.7, NA)  +  warning
     as.numeric(factor(5:10))

