

noquote {base}                               R Documentation

_C_l_a_s_s _f_o_r _`_`_n_o _q_u_o_t_e_'_' _P_r_i_n_t_i_n_g _o_f _S_t_r_i_n_g_s

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

     These functions exist both as utilities and as an exam-
     ple of using `class' and object orientation.

_U_s_a_g_e_:

     noquote(obj)
     print.noquote(obj, ...)
     obj[j]

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

     obj: any R object; typically a vector of `character'
          strings.

     ...: further options for `print'.

_V_a_l_u_e_:

     `noquote' returns its argument as an object of class
     `"noquote"'.  The function `"[.noquote"' ensures that
     the class is not lost by subsetting.

     For (default) printing, `print.noquote' will be used
     which prints characters without quotes (`"..."').

_A_u_t_h_o_r_(_s_)_:

     Martin Maechler maechler@stat.math.ethz.ch

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

     `methods',`class',`print'.

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

     letters
     nql <- noquote(letters)
     nql
     nql[1:4] <- "oh"
     nql[1:12]

     cmp.logical <- function(log.v)
     {
       ## Purpose: compact printing of logicals
       log.v <- as.logical(log.v)
       noquote(if(length(log.v)==0)"()" else c(".","|")[1+log.v])
     }
     cmp.logical(runif(20) > 0.8)

