toLatex {memisc} | R Documentation |
Additional Methods for LaTeX Representations for R objects
Description
Methods for the generic function toLatex
of package ``utils''
are provided for generating LaTeX representations
of matrices and flat contingency tables (see ftable
). Also a default method is defined
that coerces its first argument into a matrix and applies
the matrix method.
Usage
## Default S3 method:
toLatex(object,...)
## S3 method for class 'ftable':
toLatex(object,
show.titles=TRUE,
digits=0,
format="f",
useDcolumn=TRUE,
colspec= if (useDcolumn)
paste("D{.}{",LaTeXdec,"}{",ddigits,"}",sep="")
else "r",
LaTeXdec=".",
ddigits=digits,
useBooktabs=TRUE,
toprule=if(useBooktabs) "\\toprule" else "\\hline\\hline",
midrule=if(useBooktabs) "\\midrule" else "\\hline\n",
cmidrule=if(useBooktabs) "\\cmidrule" else "\\cline",
bottomrule=if(useBooktabs) "\\bottomrule" else "\\hline\\hline",
extrarowsep = NULL,
...)
## S3 method for class 'matrix':
toLatex(object,
show.titles=TRUE,
digits=0,
format="f",
useDcolumn=TRUE,
colspec= if (useDcolumn)
paste("D{.}{",LaTeXdec,"}{",ddigits,"}",sep="")
else "r",
LaTeXdec=".",
ddigits=digits,
useBooktabs=TRUE,
toprule=if(useBooktabs) "\\toprule" else "\\hline\\hline",
midrule=if(useBooktabs) "\\midrule" else "\\hline",
cmidrule=if(useBooktabs) "\\cmidrule" else "\\cline",
bottomrule=if(useBooktabs) "\\bottomrule" else "\\hline\\hline",
...)
Arguments
object |
an ftable , a matrix or an object coercable into a matrix. |
show.titles |
logical; should variable names (in case of the ftable method)
or row and column names (in case of the matrix method) be appear
in the LaTeX code? |
digits |
number of significant digits.
|
format |
format specifier, see format . |
useDcolumn |
should the dcolumn LaTeX package be used? |
colspec |
LaTeX table column format specifyer(s). |
LaTeXdec |
the decimal point in the final LaTeX output. |
ddigits |
alignment specification or digits after the decimal point. |
useBooktabs |
should the booktabs LaTeX package be used? |
toprule |
appearance of the top border of the LaTeX tabular environment. |
midrule |
how are coefficients and summary statistics
separated in the LaTeX tabular environment. |
cmidrule |
appearance of rules under section headings. |
bottomrule |
appearance of the bottom border of the LaTeX tabular environment. |
extrarowsep |
extra code to be inserted between the column titles and the
table body produced by toLatex . |
... |
further argument, currently ignored. |
Examples
toLatex(diag(5))
toLatex(ftable(UCBAdmissions))
[Package
memisc version 0.95-17
Index]