[,LongTable,ANY,ANY,ANY-method {CoreGx} | R Documentation |
[ LongTable Method
Description
Single bracket subsetting for a LongTable object. See subset for more details.
Usage
## S4 method for signature 'LongTable,ANY,ANY,ANY'
x[i, j, assays, ..., drop = FALSE]
Arguments
x |
LongTable The object to subset.
|
i |
character , numeric , logical or call
Character: pass in a character vector of drug names, which will subset the
object on all row id columns matching the vector. This parameter also
supports valid R regex query strings which will match on the colnames
of x . For convenience, * is converted to .* automatically. Colon
can be to denote a specific part of the colnames string to query.
Numeric or Logical: these select based on the rowKey from the rowData
method for the LongTable .
Call: Accepts valid query statements to the data.table i parameter as
a call object. We have provided the function .() to conveniently
convert raw R statements into a call for use in this function.
|
j |
character , numeric , logical or call
Character: pass in a character vector of drug names, which will subset the
object on all drug id columns matching the vector. This parameter also
supports regex queries. Colon can be to denote a specific part of the
colnames string to query.
Numeric or Logical: these select based on the rowID from the rowData
method for the LongTable .
Call: Accepts valid query statements to the data.table i parameter as
a call object. We have provided the function .() to conveniently
convert raw R statements into a call for use in this function.
|
assays |
character Names of assays which should be kept in the
LongTable after subsetting.
|
... |
Included to ensure drop can only be set by name.
|
drop |
logical Included for compatibility with the '[' primitive,
it defaults to FALSE and changing it does nothing.
|
Details
This function is endomorphic, it always returns a LongTable object.
Value
A LongTable
containing only the data specified in the function
parameters.
Examples
# Character
merckLongTable['ABT-888', 'CAOV3']
# Numeric
merckLongTable[1, c(1, 2)]
# Logical
merckLongTable[, colData(merckLongTable)$cellid == 'A2058']
# Call
merckLongTable[
.(drug1id == 'Dasatinib' & drug2id != '5-FU'),
.(cellid == 'A2058'),
]
[Package
CoreGx version 1.5.7
Index]