Skip to contents

Mirrors the Python morie.inspect_output(). Reads a structured output file and returns a brief summary of its contents.

Usage

morie_inspect_output(path)

Arguments

path

Path to a JSON, CSV, or RDS file.

Value

A list with components path, format, exists, size_bytes, and (on success) contents_preview plus type-appropriate metadata.

Details

Supported formats: .json (via jsonlite), .csv (via base utils::read.csv), .rds (via base::readRDS).

Examples

tmp <- tempfile(fileext = ".json")
if (requireNamespace("jsonlite", quietly = TRUE)) {
  jsonlite::write_json(list(estimate = 0.123, se = 0.045), tmp)
  morie_inspect_output(tmp)
  unlink(tmp)
}