setIdentifyHandler.ggobi       package:Rggobi       R Documentation

_R_e_g_i_s_t_e_r _c_a_l_l_b_a_c_k _f_o_r _g_g_o_b_i _p_o_i_n_t _i_d_e_n_t_i_f_i_c_a_t_i_o_n

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

     This function  is an example of how we can link R commands into
     ggobi and have ggobi ``notify'' R of certain events.  This 
     example allows us to register an R function that is called each
     time an observation is selected in ggobi's ``identify'' mode, i.e.
     when the label appears over the point. This R function is given
     information about the point being identified, a description of the
     display in which the identification is being performed, and  the
     index of the active plot. This gives a programmatic version of
     'locator'.

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

     setIdentifyHandler.ggobi(f, .gobi=getDefaultGGobi())

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

       f: the function to be invoked when  an observation is identified
          by the interactive ggobi selection/identification mechanism.
          This currently should take two arguments which are  the index
          of the observation just identified, and the display object
          (of class 'ggobiDisplay') which identifies the  window and
          ggobi instance in which the identification was made.

   .gobi: the ggobi instance with which the function should be
          registered and within which identification of a record
          triggers the callback.

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

     This is just an illustration of how we can connect the
     functionality in the two environments (R and ggobi). We can add
     other function callbacks and event notifications to provide more
     interactivity at the R level.

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

     The previously registered value of  this callback function.

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

     Duncan Temple Lang

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

     <URL: http://www.ggobi.org>

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

     'setSmootherFunction.ggobi' 'locator'

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

      f <- function(id, display) {
         print(id)
         print(display)
      }
      g <- ggobi(system.file("data", "flea.xml", package="Rggobi"), args="-noinit")
      g$setIdentifyHandler(f)
      g$setMode("Identify")
       # now move the mouse over some of the points

