Complete                package:svIDE                R Documentation

_G_e_t _a _c_o_m_p_l_e_t_i_o_n _l_i_s_t _f_o_r _a _R _c_o_d_e _f_r_a_g_m_e_n_t

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

     A list with matching items is returned in a string.

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

     Complete(code, givetype = FALSE, fieldsep = "|")

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

    code: A fraction of R code needing completion 

givetype: Do we append the type of each entry to the list? 

fieldsep: The separator to use between the item and its type 

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

     The completion list is context-dependent, and it calculated as if
     the code was entered at the command line.

     If the code ends with '$' or '[[', then the function look for
     items in a list or data.frame whose name is the last idfentifier.

     If the code ends with '@', then the function look for slots of the
     corresponding S4 object.

     If the code ends with a partial identifier name, the function
     returns all visible matching keywords.

     In all other situations, the function returns a list of the
     objects in .GlobalEnv.

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

     A string with the completion list

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

     Philippe Grosjean <phgrosjean@sciviews.org>

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

     'guiComplete'

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

         ## a data.frame
         data(iris)
             cat(Complete("item <- iris$"), "\n")
             cat(Complete("item <- iris[[", TRUE), "\n")
             
             ## An S4 object
         setClass("track", representation(x = "numeric", y = "numeric"))
         t1 <- new("track", x=1:20, y=(1:20)^2)
         cat(Complete("item2 <- t1@", TRUE), "\n")
         
         ## A partial identifier
         cat(Complete("item3 <- va", TRUE), "\n")
         
         ## Otherwise, a list with the content of .GlobalEnv
         cat(Complete("item4 <- "), "\n")

