[.ggobiDataset            package:Rggobi            R Documentation

_S_u_b_s_e_t_t_i_n_g _e_x_t_r_a_c_t_i_o_n _a_n_d _a_s_s_i_g_n_m_e_n_t_s _f_o_r _g_g_o_b_i _d_a_t_a_s_e_t_s

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

     These functions/methods allow one to treat a ggobi dataset as if
     it were a local matrix/data.frame. One can extract and assign
     elements within the  dataset. There is a fundamental difference
     between the two assignment operators ('[<-' and '[[<-'). The '[<-'
     operator first retrieves all the data from the GGobi dataset, does
     the replacement using R's semantics and then resets the data.
     '[[<-' attempts directly replaces the value(s) specified by the
     index d within the GGobi. This is much more efficient as it avoids
     copying all the data. However, the semantics are not the same as
     the usual R subsetting. This is currently intended for changing
     individual points and support for vector indices will probably
     change.

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

     "[.ggobiDataset"(x, ..., drop = FALSE)
     "[<-.ggobiDataset"(x, i, j, value)
     "[[<-.ggobiDataset"(x, i, j, value)

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

       x: the 'ggobiDataset' object

    drop: the drop argument as in the regular  matrix and data frame
          subsetting functions. This is passed to the relevant subset
          operation when the data is transferred.

     ...: the indices by which to subset the dataset

       i: the indices for selecting the rows of the matrix to which the
          values are to be assigned.

       j: the indices for selecting the columns of the matrix to which
          the values are to be assigned.

   value: the values to assigned to the elements of the matrix.

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

     At present, the assignment is unecessarily expensive in that it
     transfers the entire dataset from  ggobi, performs the usual
     subsetting operations and then transfers the results back into the
     variables of the original dataset. This can be made smarter.

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

     The subsetting operator '[' returns the result of subsetting the
     matrix corresponding to the ggobi dataset. This is identical to
     the functionality of the subsetting of a matrix.

     The assignment operator '[<-' returns the original 'ggobiDataset' 
     object. The side-effect is to modify the contents of the internal
     ggobi dataset.

_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:

     'setVariableValues.ggobi' 'getVariable.ggobi' 'getData.ggobi'
     'names.ggobiDataset' 'dimnames.ggobiDataset'

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

      g <- ggobi(system.file("data", "flea.xml", package="Rggobi"), args="-noinit")
      d <- g[[1]]
      d[1,1] <- 100
     # d[[1,1]] <- 100

      g$getData()[1,1]

      d[1:3,1:2] <- .3
      d[1:3,1:2]

