Usage
sjt.df(mydf, describe = TRUE, altr.row.col = FALSE, sort.col = NULL, sort.asc = TRUE, title = NULL, repeat.header = FALSE, show.type = FALSE, show.rownames = TRUE, show.cmmn.row = FALSE, string.cmmn = "No comment...", string.var = "Variable", big.mark = NULL, hide.progress = FALSE, CSS = NULL, encoding = NULL, file = NULL, use.viewer = TRUE, no.output = FALSE, remove.spaces = TRUE, ...)
Arguments
mydf
data frame that should be printed as table
describe
logical, if TRUE
(default), a description of the data frame's variables is given.
The description is retrieved from the describe
function.
If describe = FALSE
, the data frame's content (values) is shown. altr.row.col
logical, if TRUE
, alternating rows are highlighted with a light gray
background color.
sort.col
indicates a column, either by column name or by column index number,
that should be sorted. Default order is ascending, which can be changed with
sort.asc
argument. Default is NULL
, hence the data frame
is printed with no specific order. See 'Examples'.
sort.asc
logical, if TRUE
(default) and sort.col
is not NULL
,
data frame is ordered according to the specified column in an ascending order.
Use FALSE
to apply descending order. See 'Examples'.
title
table caption. By default, title = NULL
, hence no title will be used.
repeat.header
logical, if TRUE
, the header row will also be added at the bottom at the table. This might
be helpful, if you have longer tables and want to see the column names at the end of the table as well.
show.type
logical, if TRUE
, the variable type is shown in a separate
row respectively column.
show.rownames
logical, if TRUE
and describe = FALSE
,
first table column contains row names of data frame. Use
show.rownames = FALSE
to omit first table column with row names.
show.cmmn.row
logical, if TRUE
, an optional comment line can be added to the end / below
the table. Use string.cmmn
to specify the comment.
string.cmmn
string that will be added to the end / below the table. Only
applies, if show.cmmn.row = TRUE
.
string.var
string, label used for the first column name. Default is "Variable"
.
big.mark
character; if not NULL
, used as mark between every
thousands decimals before (hence big) the decimal point
hide.progress
logical, if TRUE
, the progress bar that is displayed when creating the
output is hidden. Default in FALSE
, hence the bar is visible.
encoding
string, indicating the charset encoding used for variable and
value labels. Default is NULL
, so encoding will be auto-detected
depending on your platform (e.g., "UTF-8"
for Unix and "Windows-1252"
for
Windows OS). Change encoding if specific chars are not properly displayed (e.g. German umlauts).
file
destination file, if the output should be saved as file.
If NULL
(default), the output will be saved as temporary file and
openend either in the IDE's viewer pane or the default web browser.
use.viewer
If TRUE
, the HTML table is shown in the IDE's viewer pane. If
FALSE
or no viewer available, the HTML table is opened in a web browser.
no.output
logical, if TRUE
, the html-output is neither opened in a browser nor shown in
the viewer pane and not even saved to file. This option is useful when the html output
should be used in knitr
documents. The html output can be accessed via the return
value.
remove.spaces
logical, if TRUE
, leading spaces are removed from all lines in the final string
that contains the html-data. Use this, if you want to remove parantheses for html-tags. The html-source
may look less pretty, but it may help when exporting html-tables to office tools.
...
other arguments passed down to the describe
function.