Create tabular output from an R data frame
Usage
stable(data, ...)
# S3 method for class 'data.frame'
stable(
data,
align = cols_left(),
panel = NULL,
span = NULL,
notes = NULL,
sumrows = NULL,
units = NULL,
drop = NULL,
sizes = tab_size(),
caption = NULL,
control = st_control(),
escape_fun = tab_escape,
inspect = FALSE,
...
)
# S3 method for class 'pmtable'
stable(data, ...)
# S3 method for class 'stable'
stable(data, ...)
# S3 method for class 'stobject'
stable(data, ...)Arguments
- data
a data.frame to convert to tabular table; the user should filter or subset so that
datacontains exactly the rows (and columns) to be processed; pmtables will not add or remove rows prior to processingdata; see alsost_new()- ...
passed to other functions:
tab_hlines(),tab_spanners(),tab_notes(),tab_cols(),tab_clear_reps()andmake_tabular()- align
an alignment object created by
cols_align(),cols_left(),cols_center(), orcols_right(); see alsost_align()- panel
character column name to use to section the table; sections will be created from unique values of
data[[panel]]; see alsost_panel()- span
a list of objects created with
colgroup(); ; see alsost_span()- notes
a character vector of notes to include at the foot of the table; use
r_fileandoutput_filefor source code and output file annotations; seetab_notes()for arguments to pass in order to configure the way notes appear in the output; see alsost_notes()- sumrows
an object created with
sumrow(); identifies summary rows and adds styling; see alsost_sumrow()- units
a named list with unit information; names should correspond to columns in the data frame
- drop
columns to remove prior to rendering the table
- sizes
an object returned from
tab_size()- caption
a caption for the table; this could be raw caption text or a caption object created with
as.caption()- control
not used at the moment
- escape_fun
a function passed to
prime_funthat will sanitize column data- inspect
if
TRUE, extra information is attached to the output as an attribute calledstable_data; seeget_stable_data()
