raw                   package:base                   R Documentation

_R_a_w _V_e_c_t_o_r_s

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

     Creates or tests for objects of type '"raw"'.

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

     raw(length = 0)
     as.raw(x)

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

  length: desired length.

       x: object to be coerced.

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

     The raw type is intended to hold raw bytes.  It is possible to
     extract subsequences of bytes, and to replace elements (but only
     by elements of a raw vector).  The relational operators (see
     Comparison) work, as do the logical operators (see Logic) with a
     bitwise interpretation.

     A raw vector is printed with each byte separately represented as a
     pair of hex digits.  If you want to see a character representation
     (with escape sequences for non-printing characters) use
     'rawToChar'.

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

     'raw' creates a raw vector of the specified length. Each element
     of the vector is equal to '0'. Raw vectors are used to store
     fixed-length sequences of bytes.

     'as.raw' attempts to coerce its argument to be of raw type.  The
     (elementwise) answer will be '0' unless the coercion succeeds.

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

     x <- "A test string"
     (y <- charToRaw(x))
     is.vector(y) # TRUE
     rawToChar(y)

