labels               package:relations               R Documentation

_L_a_b_e_l_s _f_r_o_m _s_u_b_s_e_t_t_a_b_l_e _o_b_j_e_c_t_s

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

     Creates "nice" labels from (vector-like) objects.

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

     LABELS(x, max_width = NULL, dots = "...", unique = FALSE)
     LABEL(x)

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

       x: For 'LABELS', a vector of R objects (if the object is not a
          vector, it is converted to a list of length 1). For 'LABEL',
          an R object.

max_width: Integer vector (recycled as needed) specifying the maximum
          label width for each component of 'x'. If 'NULL', there is no
          limit, otherwise, the label will be truncated to 'max_width'.

    dots: A character string appended to a truncated label. If 'NULL',
          nothing is appended.

  unique: Logical indicating whether 'make.unique' should be called on
          the final result.

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

     A character vector of labels generated from the supplied
     object(s). 'LABELS' first checks whether the vector has names and
     uses these if any; otherwise, 'LABEL' is called for each element
     to generate a "short" representation.

     'LABEL' is generic to allow user extensions. The current methods
     return the result of 'format' if the argument is of length 1 (for
     objects of classes 'set' and 'tuple': of length 5), and create a
     simple class information otherwise.

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

     LABELS(list(1, "test", X = "1", 1:5))
     LABELS(set(X = as.tuple(1:20), "test", list(list(list(1,2)))))
     LABELS(set(pair(1,2), set("a", 2), as.tuple(1:10)))

