5 \title{Suggest Appropriate Formatting}
7 Suggest an appropriate \code{xtable} alignment, appropriate number of
8 digits, or display type for a vector, or each column of a matrix or
13 xdigits(x, pad = TRUE, zap = getOption("digits"))
14 xdisplay(x, pad = TRUE)
17 \item{x}{a vector, matrix, or data frame.}
18 \item{pad}{when \code{x} is two-dimensional, \code{pad = TRUE} inserts
19 an extra code for the row names: \code{"l"} alignment , \code{0}
20 digits, and \code{"s"} display.}
21 \item{zap}{the number of digits passed to \code{zapsmall}.}
24 A character or a vector of characters, specifying the suggested
25 alignment, number of digits, or display type.
27 \author{Arni Magnusson.}
39 xalign(mtcars, pad = FALSE)
40 xalign(mtcars, pad = TRUE)
41 xtable(mtcars, align = xalign(mtcars))
43 xdigits(mtcars, pad = FALSE)
44 xdigits(mtcars, pad = TRUE)
45 xtable(mtcars, digits = xdigits(mtcars))
47 xdisplay(mtcars, pad = FALSE)
48 xdisplay(mtcars, pad = TRUE)
49 xtable(mtcars, display = xdisplay(mtcars))
51 ## Postprocessing an xtable
52 state <- xtable(state.x77)
53 align(state) <- xalign(state)
54 digits(state) <- xdigits(state)
55 display(state) <- xdisplay(state)