make_latex_tables: Creates a .tex file with LaTeX code to create a table from an...

Description Usage Arguments Value Examples

View source: R/latex.R

Description

Creates a .tex file with LaTeX code to create a table from an R data.frame.

Usage

1
2
3
4
5
6
7
8
9
make_latex_tables(
  data,
  file,
  caption = "",
  label = "",
  multi_column = NULL,
  footnote = "",
  sideways = FALSE
)

Arguments

data

A data.frame or a list of data.frames. If a data.frame, the table is created with the values in that data.frame. If a list of data.frames, the table gets one panel for each data.frame. If the list is named, will use the names to create panel labels.

file

A string with the name of the file to save the .tex as.

caption

(Optional) A string with the caption for the table (i.e. the table title).

label

(Optional) A string with the reference for the table - to be used when referencing the table in the text. If NULL,

multi_column

(Optional) A named vector with the names being the names of the multi-column and the values being the width of the multi-column.

footnote

(Optional) A string with text for the footnote of the table.

sideways

(Optional) If TRUE, will make a sideways table (useful for large tables), otherwise (default) will make a normal table.

Value

Nothing. It will create a .tex file in the current working directory.

Examples

1
2
3
4
5
## Not run: 
make_latex_tables(mtcars, file =  "text.tex", caption = "This is a description of the table",
label = "internal_table_label", footnote = "Here is some info you should know to read this table")

## End(Not run)

crimeutils documentation built on Feb. 3, 2021, 5:07 p.m.