5 \title{Suggest Appropriate Formatting}
7 Suggest an appropriate alignment, number of digits, and display type
12 xdigits(x, pad = TRUE, zap = getOption("digits"))
13 xdisplay(x, pad = TRUE)
16 \item{x}{a vector, matrix, or data frame.}
17 \item{pad}{whether to format row names, when \code{x} is
19 \item{zap}{the number of digits passed to \code{zapsmall}.}
22 \code{xalign} returns a character vector consisting of \code{"l"} and
23 \code{"r"} elements, for left/right alignment.
25 \code{xdigits} returns an integer vector.
27 \code{xdisplay} returns a character vector of \code{"d"}, \code{"f"},
28 and \code{"s"} elements, for integer/double/string display.
30 \author{Arni Magnusson.}
32 \code{\link{xtable}}, \code{\link{align}}, \code{\link{digits}},
43 xdigits(mtcars, pad = FALSE)
44 xdigits(mtcars, pad = TRUE)
48 ## Autoformat when xtable is created
49 xtable(mtcars, align = xalign(mtcars), digits = xdigits(mtcars),
50 display = xdisplay(mtcars))
52 ## Autoformat existing xtable
54 align(mt) <- xalign(mt)
55 digits(mt) <- xdigits(mt)
56 display(mt) <- xdisplay(mt)