Learn R Programming

compareGroups (version 4.9.0)

export2html: Exporting descriptives table to HTML format

Description

This function takes the result of createTable and exports the tables to HTML format.

Usage

export2html(x, file, which.table="descr", nmax = TRUE, nmax.method = 1, 
            header.labels = c(), ...)

Arguments

x

an object of class 'createTable'.

file

file where table in HTML format will be written. Also, another file with the extension '_appendix' is written with the available data table. If missing, the HTML code is returned.

which.table

character indicating which table is printed. Possible values are 'descr', 'avail' or 'both' (partial matching allowed), exporting descriptives by groups table, availability data table or both tables, respectively. Default value is 'descr'.

nmax

logical, indicating whether to show the number of subjects with at least one valid value across all row-variables. Default value is TRUE.

nmax.method

integer with two possible values: 1-number of observation with valid values in at least one row-variable; 2-total number of observations or rows in the data set or in the group. Default value is 1.

header.labels

see the 'header.labels' argument from createTable.

...

currently ignored.

See Also

createTable, export2latex, export2pdf, export2csv, export2md, export2word

Examples

Run this code

if (FALSE) {
require(compareGroups)
data(regicor)
res <- compareGroups(sex ~. -id-todeath-death-tocv-cv, regicor)
export2html(createTable(res, hide.no = 'n'), file=tempfile(fileext=".html"))
}

Run the code above in your browser using DataLab