AnnDbBimap-envirAPI      package:AnnotationDbi      R Documentation

_E_n_v_i_r_o_n_m_e_n_t-_l_i_k_e _A_P_I _f_o_r _A_n_n_D_b_B_i_m_a_p _o_b_j_e_c_t_s

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

     These methods allow the user to manipulate any AnnDbBimap object
     as if it was an environment. This environment-like API is provided
     for backward compatibility with the traditional environment-based
     maps.

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

       ls(name, pos, envir, all.names, pattern)
       exists(x, where, envir, frame, mode, inherits)
       get(x, pos, envir, mode, inherits)
       #x[[i]]
       #x$name

       ## Converting to a list
       mget(x, envir, mode, ifnotfound, inherits)
       eapply(env, FUN, ..., all.names)
       #contents(object, all.names)

       ## Additional convenience method
       sample(x, size, replace=FALSE, prob=NULL)

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

    name: An AnnDbBimap object for 'ls'. A key as a literal character
          string or a name (possibly backtick quoted) for 'x$name'. 

     pos: Ignored. 

   envir: Ignored for 'ls'. An AnnDbBimap object for 'mget', 'get' and
          'exists'. 

all.names: Ignored. 

 pattern: An optional regular expression. Only keys matching 'pattern'
          are returned. 

       x: The key(s) to search for for 'exists', 'get' and 'mget'. An
          AnnDbBimap object for '[[' and 'x$name'. An AnnDbBimap object
          or an environment for 'sample'. 

   where: Ignored. 

   frame: Ignored. 

    mode: Ignored. 

inherits: Ignored. 

       i: Single key specifying the map element to extract. 

ifnotfound: A value to be used if the key is not found. Only 'NA' is
          currently supported. 

     env: An AnnDbBimap object. 

     FUN: The function to be applied (see original 'eapply' for
          environments for the details). 

     ...: Optional arguments to 'FUN'. 

    size: Non-negative integer giving the number of map elements to
          choose. 

 replace: Should sampling be with replacement? 

    prob: A vector of probability weights for obtaining the elements of
          the map being sampled. 

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

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

     'ls', 'exists', 'get', 'mget', 'eapply', 'contents', 'sample',
     BimapFormatting, Bimap

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

       library(hgu95av2.db)
       x <- hgu95av2CHRLOC

       ls(x)[1:3]
       exists(ls(x)[1], x)
       exists("titi", x)
       get(ls(x)[1], x)
       x[[ls(x)[1]]]
       x$titi # NULL

       mget(ls(x)[1:3], x)
       eapply(x, length)
       contents(x)

       sample(x, 3)

