ltx_table_design: Designs a table based on a object returned by the table_prep...

View source: R/ltx_table_design.r

ltx_table_designR Documentation

Designs a table based on a object returned by the table_prep function

Description

This function designs the a latex table based on the data frame list returned by the table_prep function.

Usage

ltx_table_design(
  dfl,
  uselabel = TRUE,
  yhead = FALSE,
  footnote = "",
  tablenote = "",
  mancol = NULL,
  size = "\\normalsize",
  title = "table",
  titlepr = NULL,
  xabove = TRUE,
  group = NULL,
  xrepeat = FALSE,
  hyper = TRUE,
  tabenv = "longtable",
  label = NULL,
  flt = "h"
)

Arguments

dfl

list generated by the table_prep function which serves as the base of the table to be generated

uselabel

logical indicating if labels should be used for the x variable(s). If set to TRUE, the function will try to use the label attribute for the display of x variable(s).

yhead

logical indicating if the y variable should also be set as header in the table.

footnote

character string with the footnote to be placed in the footer of the page (LaTeX coding can be used for example to create line breaks)

tablenote

character string with the table note to be placed directly below the table (LaTeX coding can be used for example to create line breaks)

mancol

character string to define manual column alignment. in case argument is NULL, a sensible default will be set.

size

character string to define the font size of the table

title

character string to define the title of the table which will be added to the caption

titlepr

character string to define the prefix of the table title. Can be used to create custom table numbering

xabove

logical indicating if the first unique x variable should be placed in the table row above. Mostly used to save space on a page

group

number indicating which x variables should be grouped (displayed in table with a certain white space) and interpreted as x[1:group]

xrepeat

logical indicating if duplicate x values should be repeated in the table or not

hyper

logical indicating if a hypertarget should be set used for bookmarks

tabenv

character with the table environment to use. Currently "longtable" and "tabular" are supported

label

character with the label to add after the caption for referencing the table in text

flt

character with the type of floating environment to use (onyl applicable for tabular environment)

Details

This function designs a latex pivot table based on the results of the table_prep output. This means that the function Should always be used in conjunction with this function.

Value

The function returns a vector that defines the entire latex table. This vector can be adapted manually however it is intended to be used in a print function to add to a latex document.

Examples


## Not run: ltx_table_design(lstobject)

R3port documentation built on Sept. 22, 2023, 9:06 a.m.