MatchedGInteractions-class | R Documentation |
The MatchedGInteractions
class is a subclass of both
Matched
and GInteractions
. Therefore, it contains slots
and methods for both of these classes.
The MatchedGInteractions
class uses a delegate object
during initialization to assign its GInteractions
slots.
MatchedGInteractions
behaves as a GInteractions
but also
includes additional Matched
object functionality
(see ?Matched
). For more information about
GInteractions
see ?InteractionSet::GInteractions
.
focal
A GInteractions
object containing the focal
data to match.
pool
A GInteractions
object containing the pool
from which to select matches.
delegate
A GInteractions
object used to initialize
GInteractions
-specific slots. matchRanges()
assigns
the matched set to the slot.
matchedData
A data.table
with matched data
matchedIndex
An integer vector corresponding
to the indices in the pool
which comprise the
matched
set.
covar
A character vector describing the covariates used for matching.
method
Character describing replacement method used for matching.
replace
TRUE/FALSE describing if matching was done with or without replacement.
anchor1
anchorIds(delegate)$first
anchor2
anchorIds(delegate)$second
regions
regions(delegate)
NAMES
names(delegate)
elementMetadata
elementMetadata(delegate)
metadata
metadata(delegate)
Functions that get data from Matched subclasses (x
)
such as MatchedDataFrame, MatchedGRanges,
and MatchedGInteractions are listed below:
matchedData(x)
: Get matched data from a Matched object
covariates(x)
: Get covariates from a Matched object
method(x)
: Get matching method used for Matched object
withReplacement(x)
: Get replace method
indices(x, set)
: Get indices of matched set
For more detail check the help pages for these functions.
Additional functions that get data from Matched subclasses
(x
) such as MatchedDataFrame, MatchedGRanges,
and MatchedGInteractions include:
focal(x)
: Get focal set from a Matched object
pool(x)
: Get pool set from a Matched object
matched(x)
: Get matched set from a Matched object
unmatched(x)
: Get unmatched set from a Matched object
For more detail check the help pages for these functions.
InteractionSet::GInteractions
matchedData, covariates, method, withReplacement, indices
focal, pool, matched, unmatched
## Constructing MatchedGInteractions with matchRanges
set.seed(123)
gi <- makeExampleMatchedDataSet(type = "GInteractions")
mgi <- matchRanges(
focal = gi[gi$feature1, ],
pool = gi[!gi$feature1, ],
covar = ~ feature2 + feature3,
method = "rejection",
replace = FALSE
)
class(mgi)
## Make MatchedGInteractions example
set.seed(123)
x <- makeExampleMatchedDataSet(type = "GInteractions", matched = TRUE)
## Accessor functions for Matched class
matchedData(x)
covariates(x)
method(x)
withReplacement(x)
head(indices(x, set = 'matched'))
## Accessor functions for Matched subclasses
focal(x)
pool(x)
matched(x)
unmatched(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.