StringSet             package:Rlibstree             R Documentation

_C_r_e_a_t_e _a _S_t_r_i_n_g_S_e_t _o_b_j_e_c_t.

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

     This is a concstructor for the internal C-level  String Set data
     structure. This can be thought of as an unordered character vector
     with a length and facilities for indexing.  

     Since a string set is a set, the order of the elements is not
     meaningful. However the indexing facilities can be useful, for
     example, when sampling where the order is not important, but
     consistent across calls.

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

     StringSet(..., class = "StringSet", .els = as.character(unlist(list(...))))

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

     ...: one or more character vectors. These are are combined into
          one large character vector to be used to construct the set. 
          This allows one to make calls like 'StringSet(x, y)'.  Of
          course, this is just a convenience for  'StringSet(c(x, y))'
          - 3 more characters.

   class: the name of the class of which we want an instance.  Being
          able to specify this  allows the caller to use this function
          as a constructor for derived classes.

    .els: a character vector giving the elements for the set. This is a
          more convenient form  than ... if the values are already in a
          vector.

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

     This creates an object in C from the libstree  library and returns
     a reference to it.

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

     An object of class 'StringSet-class'.

_A_u_t_h_o_r(_s):

     Duncan Temple Lang <duncan@wald.ucdavis.edu>

_R_e_f_e_r_e_n_c_e_s:

     <URL: http://www.cl.cam.ac.uk/~cpk25/libstree/>{libstree} <URL:
     http://www.omegahat.org/Rlibstree>

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

     'SuffixTree-methods' 'StringSet-class' 'getLongestSubstring'

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

     words = c("stemming", "boing", "springs")
     set = StringSet(words)

     length(set)

     set[sample(1:3, 1)]

      # Appending values to the set 
      # Note that we don't have to re-assign the value.
     append(set, c("a", "b", "c"))

     length(set)

     lapply(set, function(x) x)
     sapply(set, function(x) x)

     sapply(set, getNativeSymbolInfo("R_LST_elementAsRString"))

