Learn R Programming

compareGroups (version 4.5.1)

export2xls: Exporting descriptives table to Exel format (.xlsx or .xls)

Description

This function takes the result of createTable and exports the tables to Excel format (.xlsx or .xls).

Usage

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

Arguments

x

an object of class 'createTable'.

file

file where table in Excel format will be written.

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. In the latter case ('both'), two sheets are built, one for each table. 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.

header.labels

see the 'header.labels' argument from createTable.

See Also

createTable, export2latex, export2pdf, export2csv, export2md, export2word

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
require(compareGroups)
data(regicor)
res <- compareGroups(sex ~. -id-todeath-death-tocv-cv, regicor)
export2xls(createTable(res, hide.no = 'n'), file=tempfile(fileext=".xlsx"))
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab