View source: R/create_codebook.R
This function generates LaTeX
code (a .tex
file) for a
nicely-formatted PDF codebook. You need to provide a data frame with a
description of each dataset and a data frame with a description of each
variable. Once you've generated the .tex
file, you can compile the PDF
using any LaTeX
editor. You need to compile the .tex
file using
XeLaTeX
instead of LaTeX
. You will need to compile the PDF
twice. You need to have the roboto
font installed, which you can
download for free on Google Fonts
(https://fonts.google.com/specimen/Roboto
). You can further customize
the .tex
file that is generated. Please report bugs and request
features at https://github.com/jfjelstul/codebookr/issues
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | create_codebook(
file_path,
datasets_input,
variables_input,
title_text,
version_text,
footer_text,
author_names,
table_of_contents = TRUE,
include_variable_type = FALSE,
theme_color = "#3B86F7",
title_font_size = 16,
heading_font_size = 35,
subheading_font_size = 12
)
|
file_path |
The path and file for the |
datasets_input |
A data frame containing information on each dataset.
This data frame must include: (1) a variable called |
variables_input |
A data frame containing infromation on each variable.
This data frame must include: (1) a variable called |
title_text |
A string containing the title for the title page. |
version_text |
A string containing the version number for the title page
(e.g., |
author_names |
A string vector containing the names of the authors for the title page or a string if there is one author. |
table_of_contents |
A logical value indicating whether to include a table of contents. |
include_variable_type |
A logical value indicating whether to include
the type of the variable in the variable description. The
|
theme_color |
A string indicating the color to use. The color should be
a valid hex code, including a leading |
title_font_size |
The size of the font for the title on the title page. You should adjust the font size to make sure your text fits. |
heading_font_size |
The size of the font for the heading for each
dataset section (i.e., the name of the dataset, contained in the
|
subheading_font_size |
The size of the font for the subheading for each
dataset section (i.e., the short label for the dataset, contained in the
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.