toLatex                package:memisc                R Documentation

_A_d_d_i_t_i_o_n_a_l _M_e_t_h_o_d_s _f_o_r _L_a_T_e_X _R_e_p_r_e_s_e_n_t_a_t_i_o_n_s _f_o_r _R _o_b_j_e_c_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     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.

_U_s_a_g_e:

     ## 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",
         ...)

_A_r_g_u_m_e_n_t_s:

  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.

_E_x_a_m_p_l_e_s:

     toLatex(diag(5))
     toLatex(ftable(UCBAdmissions))

