write_text: Write a report as text

write_textR Documentation

Write a report as text

Description

Write the human-readable rendering of a writeup, review or AI review to a file: the text print shows, laid out for a document. write_result writes the same objects as JSON documents for programs to read.

Usage

write_text(x, file, format = NULL, overwrite = FALSE, verbosity = 1L, ...)

Arguments

x

SupervisedWriteup (from writeup), SupervisedReview (from review) or AISupervisedReview (from ai_review) object.

file

Character: Path of the file to write.

format

Optional Character {"markdown"}: Output format. NULL selects the format from the extension of file: ".md" or ".markdown" for Markdown.

overwrite

Logical: If TRUE, replace an existing file.

verbosity

Integer: Verbosity level.

...

Not used.

Details

Markdown output starts at ⁠##⁠ headings and uses pipe tables, ready to convert with Pandoc or Quarto or to paste into a manuscript.

Value

The path of the file written, invisibly.

Author(s)

EDG

Examples

idx <- c(1:40, 51:90, 101:140)
mod <- train(
  iris[idx, ],
  dat_test = iris[-idx, ],
  hyperparameters = setup_CART(),
  verbosity = 0L
)
write_text(writeup(mod), file.path(tempdir(), "writeup.md"))
write_text(review(mod), file.path(tempdir(), "review.md"))

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