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{"l"} for the row names.}
20 \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))
42 xdigits(mtcars, pad = FALSE)
43 xdigits(mtcars, pad = TRUE)
44 xtable(mtcars, digits = xdigits(mtcars))
45 xdisplay(mtcars, pad = FALSE)
46 xdisplay(mtcars, pad = TRUE)
47 xtable(mtcars, display = xdisplay(mtcars))
49 ## Postprocessing an xtable
50 state <- xtable(state.x77)
51 align(state) <- xalign(state)
52 digits(state) <- xdigits(state)
53 display(state) <- xdisplay(state)