Learn R Programming

joinspy (version 0.7.3)

log_report: Log Join Report to File

Description

Writes a JoinReport object to a file for audit trails and reproducibility. Supports plain text, JSON, and RDS formats.

Usage

log_report(report, file, append = FALSE, timestamp = TRUE)

Value

Invisibly returns the file path.

Arguments

report

A JoinReport object from join_spy() or retrieved via last_report().

file

File path to write to. Extension determines format:

  • .txt or .log: Plain text (human-readable)

  • .json: JSON format (machine-readable)

  • .rds: R binary format (preserves all data)

append

Logical. If TRUE, appends to existing file (text/log only). Default FALSE.

timestamp

Logical. If TRUE (default), includes timestamp in output.

See Also

join_spy(), last_report()

Examples

Run this code
orders <- data.frame(id = 1:3, value = c(10, 20, 30))
customers <- data.frame(id = c(1, 2, 4), name = c("A", "B", "D"))

report <- join_spy(orders, customers, by = "id")

# Log to temporary file
tmp <- tempfile(fileext = ".log")
log_report(report, tmp, append = TRUE)
unlink(tmp)

Run the code above in your browser using DataLab