Skip to contents

Inspects the extension / content and dispatches to the native JSON, XML, HTML, CSV/TSV, or Parquet parser, returning a consistent morie_dataset object.

Usage

morie_fetch_unified(path, format = NULL)

Arguments

path

A local file path.

format

Optional explicit format ("json", "xml", "html", "csv", "tsv", "parquet"); inferred from the extension otherwise.

Value

An object of class morie_dataset: list with data, format, source, n_rows (when tabular).

Examples

d <- data.frame(a = 1:3, b = c("x", "y", "z"))
fc <- tempfile(fileext = ".csv")
write.csv(d, fc, row.names = FALSE)
out <- morie_fetch_unified(fc)
out$n_rows
#> [1] 3