get.align: Create a character vector to use in an align argument for...

View source: R/latex.R

get.alignR Documentation

Create a character vector to use in an align argument for xtable()

Description

Create a character vector to use in an align argument for xtable()

Usage

get.align(num, first.left = TRUE, just = "r")

Arguments

num

The number of columns

first.left

If TRUE, set the first column to be left-justified

just

The justification of all columns, unless first.left is TRUE. "r", "l", or "c"

Value

A character vector to use in an align argument for xtable()

Examples

library(gfutilities)
library(xtable)
d <- data.frame(a = c(1,2,3), b = c(10,20,30))
print(xtable(d,
             caption = "The table caption",
             label = "tab:example",
             align = get.align(ncol(d), just = "c")),
      caption.placement = "top",
      include.rownames = FALSE,
      table.placement = "H",
      sanitize.text.function = function(x){x},
      size = latex.size.str(12, 11))

pbs-assess/gfutilities documentation built on Sept. 18, 2023, 7:57 a.m.