writeLatex produces publication-quality LaTeX reports: Toplines (one-way frequency tables) or Banners (cross tabulations).

writeLatex(
  data_summary,
  theme = themeDefaultLatex(),
  filename = getName(data_summary),
  title = getName(data_summary),
  subtitle = NULL,
  table_of_contents = FALSE,
  sample_desc = NULL,
  field_period = NULL,
  moe = NULL,
  append_text = NULL,
  proportions = TRUE,
  pdf = FALSE,
  open = FALSE,
  logging = FALSE
)

Arguments

data_summary

An object of class Toplines or Crosstabs.

theme

A theme object (default: `themeDefaultLatex`).

filename

character. The name of the output file (without extension).

title

An optional title. Defaults to the data summary title.

subtitle

An optional character subtitle. Defaults to an empty string.

table_of_contents

logical. Should a list of tables be included at the start of the report Defaults to FALSE.

sample_desc

A character string describing the sample.

field_period

A character string describing the field period.

moe

An optional numeric margin of error.

append_text

An optional character string that, if supplied, will be appended after the final table. Useful for adding in disclosure information. Defaults to an empty string.

proportions

logical. If TRUE the output report shows proportions, if FALSE the report shows counts.

pdf

logical. Compile LaTeX using pdflatex? Implemented only on MacOS/Linux.

open

logical. If PDF document was produced, open it with the default application? Only implemented for MacOS.

logging

Leave logs in the working directory, defaults to FALSE

Value

If returndata is set to TRUE, a processed data that was used to produce the report is returned. Otherwise NULL is returned.

Examples

if (FALSE) { # toplines report toplines_summary <- crosstabs(crunch_dataset, weight = "weight") writeLatex(toplines_summary, "filename") # crosstabs report crosstabs_summary <- crosstabs(crunch_dataset, banner = banner_object) writeLatex(crosstabs_summary, "filename") }