table-generics {iSEE} | R Documentation |
Generic to control the creation of a data.frame to show in the datatable
widget of a Table panel.
Table subclasses can specialize methods to modify the behavior of .generateOutput
.
In .generateTable(x, envir)
, the following arguments are required:
x
, an instance of a Table subclass.
envir
, the evaluation environment in which the data.frame is to be constructed.
This can be assumed to have se
, the SummarizedExperiment object containing the current dataset;
possibly col_selected
, if a multiple column selection is being transmitted to x
;
and possibly row_selected
, if a multiple row selection is being transmitted to x
.
In return, the method should add a tab
variable in envir
containing the relevant data.frame.
This will automatically be passed to the datatable
widget as well as being stored in pObjects$contents
.
The return value should be a character vector of commands that produces tab
when evaluated in envir
.
Each row of the tab
data.frame should correspond to one row or column in the SummarizedExperiment envir$se
for RowTables and ColumnTables respectively.
Unlike .generateDotPlotData
, it is not necessary for all rows or columns to be represented in this data.frame.
Ideally, the number and names of the columns of the data.frame should be fixed for all calls to .generateTable
.
Violating this principle may result in unpredictable interactions with existing values in the SearchColumns
slot.
Nonetheless, the app will be robust to mismatches, see filterDT
for more details.
Any internal variables that are generated by the commands should be prefixed with .
to avoid potential clashes with reserved variable names in the rest of the application.
Aaron Lun