overview_latex: overview_latex

View source: R/overview_latex.R

overview_latexR Documentation

overview_latex

Description

Produces a 'LaTeX' output for output obtained via overview_tab and overview_crosstab

Usage

overview_latex(
  obj,
  title = "Time and scope of the sample",
  id = "Sample",
  time = "Time frame",
  crosstab = FALSE,
  cond1 = "Condition 1",
  cond2 = "Condition 2",
  save_out = FALSE,
  file_path,
  label = "tab:tab1",
  fontsize,
  file,
  path
)

Arguments

obj

Overview object produced by overview_tab or overview_crosstab

title

Caption of the table (default is "Time and scope of the sample")

id

The name of the left column (default is "Sample"), will be ignored if crosstab is TRUE

time

The name of the right column (default is ("Time frame")), will be ignored if crosstab is TRUE

crosstab

Logical argument, if TRUE produces a crosstab output, default is FALSE

cond1

Description for the first condition (character), will be ignored if crosstab is FALSE. This should correspond to the input for cond1 in overview_crosstab

cond2

Description for the second condition (character), will be ignored if crosstab is FALSE. This should correspond to the input for cond2 in overview_crosstab

save_out

Optional argument, exports the output table as a .tex file, default is FALSE

file_path

Specifies the path and file name (.tex) where you store your output

label

Specifies the label (default is "tab:tab1")

fontsize

Specifies the font size (all 'LaTeX' font sizes such as "scriptsize" or "small" work)

file

This argument is deprecated. Please use "file_path" instead and add the full path.

path

This argument is deprecated. Please use "file_path" instead and add the full path.

Value

A 'LaTeX' output that can either be copy-pasted in a text document or exported directed as a .tex file

Examples

data(toydata)

overview_object <- overview_tab(dat = toydata, id = ccode, time = year)
overview_latex(
  obj = overview_object,
  title = "Some nice title",
  crosstab = FALSE
)

#' overview_object <- overview_tab(dat = toydata, id = ccode, time = year)
overview_latex(
  obj = overview_object,
  title = "Some nice title",
  file_path = "some/path_to/your_output_file.tex"
)

overview_ct_object <- overview_crosstab(
  dat = toydata,
  cond1 = gdp,
  cond2 = population,
  threshold1 = 25000,
  threshold2 = 27000,
  id = ccode,
  time = year
)
overview_latex(
  obj = overview_ct_object,
  title = "Some nice title for a cross tab",
  crosstab = TRUE,
  cond1 = "Name of first condition",
  cond2 = "Name of second condition"
)

cosimameyer/overviewR documentation built on Feb. 15, 2023, 9:23 a.m.