export2csv | R Documentation |
This function takes the result of createTable
and exports the tables to plain text (CSV) format.
export2csv(x, file, which.table="descr", sep=",", nmax = TRUE, nmax.method = 1,
header.labels = c(), ...)
x |
an object of class 'createTable'. |
file |
file where table in CSV format will be written. Also, another file with the extension '_appendix' is written with the available data table. |
which.table |
character indicating which table is printed. Possible values are 'descr', 'avail' or 'both' (partial matching allowed), exporting descriptives by groups table, available data table or both tables, respectively. Default value is 'descr'. |
sep |
character. The variable separator, same as 'sep' argument from |
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 |
... |
other arguments passed to |
The default way to compute the 'N' shown in the bivariate table header, controlled by 'nmax' argument, has been changed from previous versions (<1.3). In the older versions 'N' was computed as the maximum across the cells withing each column (group) from the 'available data' table ('avail').
createTable
, export2latex
, export2pdf
, export2html
, export2md
, export2word
## Not run:
require(compareGroups)
data(regicor)
res <- compareGroups(sex ~. -id-todeath-death-tocv-cv, regicor)
export2csv(createTable(res, hide.no = 'n'), file=tempfile(fileext=".csv"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.