noquote                 package: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 example 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)

