[,LongTable,ANY,ANY,ANY-method {CoreGx} | R Documentation |
Single bracket subsetting for a LongTable object. See subset for more details.
## S4 method for signature 'LongTable,ANY,ANY,ANY' x[i, j, assays, ..., drop = FALSE]
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. |
This function is endomorphic, it always returns a LongTable object.
A ['LongTable'] containing only the data specified in the function parameters.
# Character merckLongTable['CAOV3', 'ABT-888'] # Numeric merckLongTable[1, c(1, 2)] # Logical merckLongTable[rowData(merckLongTable)$cell_line1 == 'A2058', ] # Call merckLongTable[.(cell_line1 == 'A2058'), .(drug1 == 'Dasatinib' & drug2 != '5-FU')]