08.04.2015 Views

The sfsmisc Package - NexTag Supports Open Source Initiatives

The sfsmisc Package - NexTag Supports Open Source Initiatives

The sfsmisc Package - NexTag Supports Open Source Initiatives

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

40 mat2tex<br />

Arguments<br />

x<br />

file<br />

nam.center<br />

col.center<br />

append<br />

digits<br />

title<br />

a matrix<br />

names the file to which LaTeX commands should be written<br />

character specifying row names should be center; default "l".<br />

character (vector) specifying how the columns should be centered; must have<br />

values from c("l","c","r"); defaults to "c".<br />

logical; if FALSE, will destroy the file file before writing commands to it;<br />

otherwise (by default), simply adds commands at the end of file file.<br />

integer; setting of options(digits=..) for purpose of number representation.<br />

a string, possibly using LaTeX commands, which will span the columns of the<br />

LaTeX matrix<br />

Value<br />

No value is returned. This function, when used correctly, only writes LaTeX commands to a file.<br />

Author(s)<br />

For S: Vincent Carey 〈vjcarey@sphunix.sph.jhu.edu〉, from a post on Feb.19, 1991 to S-news. Port<br />

to R (and a bit more) by Martin Maechler 〈maechler@stat.math.ethz.ch〉.<br />

See Also<br />

latex in package Hmisc is more flexible (but may surprise by its auto-printing ..).<br />

Examples<br />

mex \begin{tabular} {| l|| c| c| c|}<br />

##> \multicolumn{ 4 }{c}{ $\pi, e$, etc. } \\ \hline<br />

##> \ & a & b & c \\ \hline \hline<br />

##> $\pi$ & 3.14 & 1.57 & 0.785 \\ \hline<br />

##> $e$ & 2.72 & 7.39 & 20.1 \\ \hline<br />

##> \end{tabular}<br />

## Now you have to properly embed the contents of this file<br />

## in a LaTeX document -- for example, you will need a<br />

## preamble, the \begin{document} statement, etc.<br />

## Note that the backslash needs protection in dimnames<br />

## or title actions.<br />

mat2tex(mex, stdout(), col.center = c("r","r","c"))

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!