longtable_head: For use with 'xtable"s 'add.to.row' when 'tabular.environment...

View source: R/longtable_head.R

longtable_headR Documentation

For use with xtable's add.to.row when tabular.environment = "longtable"

Description

Format header information from an xtable for adding to the printed output at position 0.

Usage

longtable_head(
  xtab,
  add.to.caption = " (continued)",
  footnote = "Continued on next page",
  double.header = FALSE,
  pos = 0
)

Arguments

xtab

An object of class xtable.

add.to.caption

Text to be added to all but the last captions, default is " (continued)".

footnote

Text to be added to the footnote of all but the last page, default is "Continued on next page".

double.header

Logical, does the table have a double header?

pos

position in table to insert the header commands, default is 0. Use 1 if double header isTRUE

Value

A single character string

Examples


xtab <- xtable::xtable(iris, caption = "Iris Data")
xtable::print.xtable(xtab, tabular.environment = "longtable", floating = FALSE,
                     hline.after = c(-1,0),
                     add.to.row = longtable_head(xtab))


EstherHerbert/Useful.functions documentation built on Jan. 31, 2025, 10:41 a.m.