write_result: Write a portable result with optional Parquet payloads

View source: R/result_storage.R

write_resultR Documentation

Write a portable result with optional Parquet payloads

Description

Eligible outcomes, predictions, probabilities and resampling indices can stay inline or reference compressed Parquet files beside the JSON document. The outer resample structure remains in JSON. Fitted runtime objects are excluded. Move the JSON file and its accompanying directory together.

Usage

write_result(
  x,
  file,
  storage = c("auto", "inline", "parquet"),
  inline_max_bytes = 65536,
  base_dir = dirname(file),
  overwrite = FALSE
)

Arguments

x

Published S7 report object.

file

Character: Output JSON path.

storage

Character: "inline", "parquet", or "auto".

inline_max_bytes

Numeric: In auto mode, maximum estimated uncompressed payload bytes kept inline: eight per numeric value or categorical code, one per Boolean, or UTF-8 string bytes plus eight per string.

base_dir

Character: Directory resolving existing DataRef paths. Defaults to the output directory.

overwrite

Logical: Replace an existing JSON file.

Value

x, invisibly.

Examples

result <- resample(1:6, setup_KFold(n_resamples = 2L), verbosity = 0L)
directory <- tempfile("result-")
dir.create(directory)
write_result(result, file.path(directory, "result.json"), storage = "parquet")
unlink(directory, recursive = TRUE)

rtemis documentation built on Oct. 20, 2026, 1:06 a.m.