Generates a JSON representation of a dataset’s structure. Each column includes class, number of unique values, and optionally a truncated list of values unless excluded by type or pattern. All columns are retained in the output.

json_data_structure(
  dataset,
  dataset_name = NULL,
  n_first = 100,
  cols_exclude = "(bsn|id$|num[mb]er)",
  output_file = NULL
)

Arguments

dataset

data.frame Input dataset.

dataset_name

Optional name of dataset, used in JSON root.

n_first

Maximum number of unique values to include.

cols_exclude

Regular expression of column names to exclude values from.

output_file

Output path for JSON file.

Value

Invisibly returns the structured list written to JSON.