Skip to contents

Export a KRT as a delimited table or spreadsheet

Usage

export_tabular(
  x,
  path = NULL,
  format = c("csv", "tsv", "xlsx"),
  profile = NULL,
  view = NULL,
  audience = c("author", "public"),
  redact = NULL,
  attribution = TRUE
)

Arguments

x

A krt_tbl.

path

Output path, or NULL to return the content (csv/tsv only).

format

"csv", "tsv", or "xlsx".

profile

Profile whose columns to use (default the wide core view).

view

Optional explicit view name.

audience

"author" (full) or "public" (redacted).

redact

Redaction strength for public output, or FALSE to disable.

attribution

If TRUE (default), a path is given, and profile carries an attribution requirement, write it as a sidecar next to path.

Value

The path (invisibly) when written, or the delimited text.

Examples

cat(substr(export_tabular(krt_example, format = "csv"), 1, 60))
#> Warning: lossy-export: 'csv' is a lower-fidelity view; use 'json' or 'yaml' for a lossless copy.
#> "resource_id","resource_type","display_name","source_name","