These methods are part of the Bimap interface
?Bimap for a quick overview of the Bimap
objects and their interface).
They are divided in 2 groups: (1) methods for getting or setting the direction of a Bimap object and (2) methods for getting, counting or setting the left or right keys (or mapped keys only) of a Bimap object. Note that all the methods in group (2) are undirected methods i.e. what they return does NOT depend on the direction of the map (more on this below).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
## Getting or setting the direction of a Bimap object direction(x) direction(x) <- value revmap(x, ...) ## Getting, counting or setting the left or right keys (or mapped ## keys only) of a Bimap object Lkeys(x) Rkeys(x) Llength(x) Rlength(x) mappedLkeys(x) mappedRkeys(x) count.mappedLkeys(x) count.mappedRkeys(x) Lkeys(x) <- value Rkeys(x) <- value ## S4 method for signature 'Bimap' subset(x, Lkeys = NULL, Rkeys = NULL, drop.invalid.keys = FALSE) ## S4 method for signature 'AnnDbBimap' subset(x, Lkeys = NULL, Rkeys = NULL, drop.invalid.keys = FALSE, objName = NULL)
A Bimap object.
A single integer or character string indicating the new direction
Extra argument for
Extra arguments for
All Bimap objects have a direction which can be left-to-right
(i.e. the mapping goes from the left keys to the right keys)
or right-to-left (i.e. the mapping goes from the right keys to the
A Bimap object
x that maps from left to right is
considered to be a direct map. Otherwise it is considered to be an
indirect map (when it maps from right to left).
1 on a direct map and
The direction of
x can be changed with
direction(x) <- value
where value must be
An easy way to reverse a map (i.e. to change its direction) is to
direction(x) <- - direction(x), or, even better, to use
revmap(x) which is actually the recommended way for doing it.
Rkeys methods return respectively
the left and right keys of a Bimap object.
keys method (see
more information), these methods are direction-independent i.e. what
they return does NOT depend on the direction of the map.
Such methods are also said to be "undirected methods"
and methods like the
keys method are said
to be "directed methods".
All the methods described below are also "undirected methods".
Rlength(x) are equivalent to
(but more efficient than)
mappedRkeys) method returns
the left keys (or right keys) that are mapped to at least one right
key (or one left key).
equivalent to (but more efficient than)
length(mappedRkeys(x)), respectively. These functions give
overall summaries, if you want to know how many Rkeys correspond to a
given Lkey you can use the
Lkeys(x) <- value and
Rkeys(x) <- value are the
undirected versions of
keys(x) <- value (see
for more information) and
subset(x, Lkeys=new_Lkeys, Rkeys=new_Rkeys)
is provided as a convenient way to reduce the sets of left
and right keys in one single function call.
A Bimap object of the same subtype as
A character vector for
A single non-negative integer for
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
library(hgu95av2.db) ls(2) x <- hgu95av2GO x summary(x) direction(x) length(x) Llength(x) Rlength(x) keys(x)[1:4] Lkeys(x)[1:4] Rkeys(x)[1:4] count.mappedkeys(x) count.mappedLkeys(x) count.mappedRkeys(x) mappedkeys(x)[1:4] mappedLkeys(x)[1:4] mappedRkeys(x)[1:4] y <- revmap(x) y summary(y) direction(y) length(y) Llength(y) Rlength(y) keys(y)[1:4] Lkeys(y)[1:4] Rkeys(y)[1:4] ## etc... ## Get rid of all unmapped keys (left and right) z <- subset(y, Lkeys=mappedLkeys(y), Rkeys=mappedRkeys(y))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.