Skip to contents

Detects the format (JSON, YAML, ASAP/Cell Press table, or generic tabular) and reads it into a krt_tbl.

Usage

import_krt(input, format = NULL, profile = NULL, mapping = NULL, sheet = 1)

Arguments

input

A file path, or a JSON/YAML string.

format

One of "json", "yaml", "asap", "tabular"; auto-detected when NULL.

profile

Optional profile to assign to the imported table.

mapping

Optional column-to-field mapping for tabular import.

sheet

Worksheet (for xlsx).

Value

A krt_tbl.

Examples

k <- import_krt(write_krt_json(krt_example))
length(k$resources)
#> [1] 6