File: latexTabular.Rd

package info (click to toggle)
hmisc 4.2-0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 3,332 kB
  • sloc: asm: 27,116; fortran: 606; ansic: 411; xml: 160; makefile: 2
file content (59 lines) | stat: -rw-r--r-- 2,292 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
\name{latexTabular}
\alias{latexTabular}
\title{Convert a Data Frame or Matrix to a LaTeX Tabular}
\description{
\code{latexTabular} creates a character vector representing a matrix or
data frame in a simple \samp{tabular} environment.
}
\usage{
latexTabular(x, headings=colnames(x),
             align =paste(rep('c',ncol(x)),collapse=''),
             halign=paste(rep('c',ncol(x)),collapse=''),
             helvetica=TRUE, translate=TRUE, hline=0, center=FALSE, \dots)
}
\arguments{
  \item{x}{a matrix or data frame, or a vector that is automatically
		converted to a matrix}
  \item{headings}{a vector of character strings specifying column
		headings for \samp{latexTabular}, defaulting to \code{x}'s
	\code{colnames}.  To make multi-line headers use the newline character
	inside elements of \code{headings}.}
  \item{align}{a character strings specifying column
		alignments for \samp{latexTabular}, defaulting to
		\code{paste(rep('c',ncol(x)),collapse='')} to center.  You may
		specify \code{align='c|c'} and other LaTeX tabular formatting.}
  \item{halign}{a character strings specifying alignment for
		column headings, defaulting to centered.}
  \item{helvetica}{set to \code{FALSE} to use default LaTeX font in
		\samp{latexTabular} instead of helvetica.}
	\item{translate}{set to \code{FALSE} if column headings and table
		entries are already in
		LaTeX format, otherwise \code{latexTabular} will run them through
		\code{latexTranslate}}
	\item{hline}{set to 1 to put \code{hline} after heading, 2 to also put
		\code{hline}s before and after heading and at table end}
	\item{center}{set to \code{TRUE} to enclose the tabular in a LaTeX
		\code{center} environment}
	\item{\dots}{if present, \code{x} is run through \code{format.df} with
		those extra arguments}
  }
\value{a character string containing LaTeX markup}
\author{
  Frank E. Harrell, Jr.,\cr
  Department of Biostatistics,\cr
  Vanderbilt University,\cr
  \email{f.harrell@vanderbilt.edu}
}
\seealso{
\code{\link{latex.default}}, \code{\link{format.df}}
}
\examples{
x <- matrix(1:6, nrow=2, dimnames=list(c('a','b'),c('c','d','this that')))
latexTabular(x)   # a character string with LaTeX markup
}
\keyword{utilities}
\keyword{interface}
\keyword{methods}
\keyword{file}
\keyword{character}
\keyword{manip}