cb_export: Export codebook to file

View source: R/05_render.R

cb_exportR Documentation

Export codebook to file

Description

Supports multiple formats based on file extension:

  • .html - rendered gt table (presentation)

  • .csv - raw tibble (programmatic reuse)

  • .docx - editable Word table (paper supplements, presentations)

  • .xlsx - editable spreadsheet with filters

Usage

cb_export(path, variables = NULL, ...)

Arguments

path

File path. Extension determines format. There is no default: the destination must be supplied explicitly (e.g. a file under tempdir() or a directory chosen by the user).

variables

Optional character vector. If provided, exports only these variables (in the given order). Default: all.

...

Additional arguments passed to cb_render() for HTML (e.g. show_code).

Details

For .docx and .xlsx, you can pass variables = c(...) to export only a subset (useful for paper supplements / presentations).

Value

Invisible path.


autocodebook documentation built on June 9, 2026, 1:09 a.m.