View source: R/result_storage.R
| write_result | R Documentation |
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.
write_result(
x,
file,
storage = c("auto", "inline", "parquet"),
inline_max_bytes = 65536,
base_dir = dirname(file),
overwrite = FALSE
)
x |
Published S7 report object. |
file |
Character: Output JSON path. |
storage |
Character: |
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. |
x, invisibly.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.