listTable: List Table

Description Usage Arguments Examples

Description

Convert a data.frame object into a LaTeX table.

Usage

1
2
3
4
5
6
7
8
  listTable(fileName, longtable = TRUE, landscape = FALSE,
    caption = "", fontSize = "small", dataframe,
    zebraPattern = "none", by = names(dataframe)[1],
    orderGroups = FALSE, colNames = names(dataframe),
    vars = names(dataframe), fixedColVars = c(),
    fixedColWdths = c(), markVar = "", markVarVal = "",
    toLatexChar = TRUE, appendix = TRUE, subsection = NULL,
    marker = NULL, append = FALSE)

Arguments

fileName

character. A description of the file connection.

longtable

logical. Toggle ‘longtable’ or ‘table’ environment. Defaults to ‘TRUE’.

landscape

logical. Use ‘landscape’ environment. Defaults to ‘FALSE’.

caption

character. Main table caption.

fontSize

character. Define font size from one of the following: ‘tiny’, ‘scriptsize’, ‘footnotesize’, ‘small’, ‘normalsize’, ‘large’, ‘Large’, ‘LARGE’, ‘huge’, ‘Huge’. Default is ‘small’.

dataframe

data.frame. Provides content for list table.

zebraPattern

character. Defaults to ‘none’, other options are ‘plain’, ‘group’ and ‘plaingroup.’ ‘plaingroup’ is only recommended for large groups (more than four objects in a group).

by

character. Column used to generate zebra pattern, defaulting to the first column in ‘dataframe’.

orderGroups

logical. If ‘TRUE’ order the data by ‘by’. This is recommened when ‘zebraPattern’ is set to ‘group’ or ‘plaingroup’.

colNames

character vector. Define column name headers for ‘dataframe’.

vars

character vector. Column names to select from ‘dataframe’.

fixedColVars

character vector. Column variables.

fixedColWdths

character vector. Fixed width for each column.

markVar

character vector. Marker variable.

markVarVal

character vector. Value for each marker variable.

toLatexChar

logical. If ‘TRUE’ text will be checked and escaped should they contain special LaTeX characters.

appendix

logical. If ‘TRUE’ the function will require the subsection and marker arguments since it will have to reference the tables in the future.

subsection

character. Name of document subsection that refers to this table.

marker

character. Marker for document subsection that refers to this table.

append

logical. If ‘TRUE’ output will be appended instead of overwritten.

Examples

1
2
3
listTable(fileName='', caption="\\label{table:listtable}Table of groupings", zebraPattern='group',
dataframe=data.frame(code=c('(a)', '(b)', '(c)'), def=c("apple, orange", "dog, cat, horse", "windows, linux, mac")),
appendix=FALSE) # print generated table to standard out

harrelfe/rreport documentation built on May 17, 2019, 2:48 p.m.