Given meta data and summary objects, create a codebook using YouGov's typical codebook presentation.

writeCodeBookLatexGeneric(
  ds,
  meta,
  pdf = TRUE,
  title = NULL,
  subtitle = NULL,
  table_of_contents = FALSE,
  sample_desc = NULL,
  field_period = NULL,
  preamble = NULL,
  suppress_zero_counts = FALSE,
  appendix = TRUE,
  logo = NULL,
  position = NULL,
  path = NULL,
  filename = NULL,
  logging = FALSE,
  open = FALSE,
  ...
)

Arguments

ds

A data.frame

meta

A data.frame containing meta data which requires specific columns as follows:

  • name: A longer descriptive name should not be more than 80 characters, will show in the top right of the codebook item.

  • alias: The name of the column reference in df. This is displayed in the top right

  • description: A longer form description of the data held in this variable

  • notes: Any kind of additional information that may be relevant to the variable but not excplicitly included in the description. Example include a source description, or perhaps an explanation of if / why missings are importantant, or with survey data it is often useful to identify skip patterns or sub-population specific questions (ie, only asked of people who voted)

pdf

Should we write directly to pdf? Defaults to TRUE. title = getName(data_summary),

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.

preamble

A latex string, usually a methodological statement. LaTeX should be escaped.

suppress_zero_counts

Should zero count categories be supressed? Defaults to FALSE.

appendix

Should categorical questions with greater than 20 categories be put in an apppendix? Defaults to TRUE.

logo

Default to NULL. A character string one of: yougov or ygblue. Includes the logo automatically. Also accepts a path to a logo file.

position

Defaults to NULL. Identifies the position of the table on the page. Accepts "c", "l", or "r". Default position is left aligned tables.

path

The path to place .tex and .pdf files.

filename

A string. The desired basename of the resulting file with no extension (i.e, "mycodebook")

logging

Leave logs in the working directory, defaults to FALSE

open

Should the resulting PDF be opened? Defaults to FALSE

...

Additional arguments passed to kable_styling Unused.