Adds a table to a webpage, based on specified or selected variables.
Usage
output_table(variables = NULL, dataset = NULL, dataview = NULL,
id = NULL, click = NULL, subto = NULL, options = NULL,
features = NULL, filters = NULL, wide = TRUE, class = "compact",
datatables = TRUE)
Arguments
- variables
The ID of a variable selecting input, or a list specifying columns (if
wide
isTRUE
) or included variables. Each entry should be a list with at least have aname
entry with a variable name. Atitle
entry can be used to set a different display name for the variable.name
can also refer to feature names, which can be specified with asource
entry set to"features"
. For example,list(title = "Variable A", name = "a", source = "features")
. A vector can also be used to specify variable names, with names setting titles (e.g.,c("Variable A" = "a")
). If not specified, sources are attempted to be resolved automatically.- dataset
The name of a dataset, or ID of a dataset selector, to find
variables
in; used ifdataview
is not specified.- dataview
The ID of an
input_dataview
component.- id
Unique ID of the table.
- click
The ID of an input to set to a clicked row's entity ID.
- subto
A vector of output IDs to receive hover events from.
- options
A list of configuration options if
datatables
isTRUE
, see DataTables Documentation; otherwise, only thescrollY
option has an effect.- features
A list of features columns to include if multiple variables are included and
wide
isTRUE
.- filters
A list with names of
meta
entries (fromvariable
entry indata_add
'smeta
list), and values of target values for those entries, or the IDs of value selectors.- wide
Logical; if
FALSE
, variables and years are spread across rows rather than columns. Ifvariables
specifies a single variable,wide = FALSE
will show the variable in a column, andwide = TRUE
will show the variable across time columns.- class
Class names to add to the table.
- datatables
Logical; if
TRUE
, uses DataTables.