Description Usage Arguments Value
This function is the wrapper of 'DT::datatable()' and set default values of some parameters frequently used. You can use 'sp_dable()' to output the caption reference-able and specify the columns to be sorted with DESC or ACS method. Auto detecting column names depending on global options is the most usefully function of this function. You can also set 'detect_colnames = FALSE' and then specify the 'colnames' with a character vector of column names of the data.
1 |
data |
a data frame to be displayed with 'DT::datatable()'. |
ref_text |
a character. It can be text reference character like '"(ref:<label>)"' or the caption of table like '"Caption of table"'. |
detect_colnames |
logic, default TRUE. If set 'TRUE' then the function will detect colnames depending on the global options 'report.options$colnameMap' and the column names of 'data'. |
colnames |
character vector of column names. When you want to use auto-detection of column names, you can leave it missing since this function will not consider the parameter. |
order |
nested list of column index and sorting method. You can specify multiple columns to be sorted. Every sorting option is in the form of 'list(<index of column>, <sorting method>)' (Note that the index of column is begin at 0) and all sorting options should be put in a list. The sorting method can be "desc" or "acs". |
... |
other params of 'DT::datatable()' except 'data' and 'colnames'. |
None. But print HTML reference-able caption and HTML widget of DT::datatable.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.