| code_book | R Documentation |
code_book() creates an interactive and exportable codebook summarizing all variables of a data frame.
It builds upon varlist() to provide an overview of variable names, labels,
classes, and representative values in a sortable, searchable table.
The output is displayed as an interactive DT::datatable() in the Viewer pane,
allowing filtering, column reordering, and export (copy, print, CSV, Excel, PDF)
directly.
code_book(x, values = FALSE, include_na = FALSE, title = "Codebook", ...)
x |
A data frame or tibble. |
values |
Logical. If |
include_na |
Logical. If |
title |
Optional character string displayed as the table title in the Viewer.
Defaults to |
... |
Additional arguments (currently unused). |
The interactive datatable supports column sorting, searching, and
client-side export to various formats.
All exports occur client-side through the Viewer or Tab.
A DT::datatable object.
Requires the following package:
DT
varlist() for generating the underlying variable summaries.
## Not run:
# Example with a built-in dataset
df <- head(mtcars)
# Launch the interactive codebook (opens in Viewer)
code_book(df)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.