Restores an audit_trail() previously saved with write_trail(). The
file format is detected automatically from the file extension (.rds for
RDS, .json for JSON), or can be specified explicitly via format.
Arguments
- file
Path to an RDS or JSON file created by
write_trail().- format
One of
"rds","json", orNULL(default). WhenNULL, the format is inferred from the file extension.
Value
A reconstructed audit_trail() object with all S3 classes
restored.
See also
Other audit export:
audit_export(),
trail_to_df(),
trail_to_list(),
write_trail()
Examples
trail <- audit_trail("example")
mtcars |> audit_tap(trail, "raw")
tmp <- tempfile(fileext = ".rds")
write_trail(trail, tmp)
restored <- read_trail(tmp)
print(restored)
#>
#> ── Audit Trail: "example" ──────────────────────────────────────────────────────
#> Created: 2026-03-24 12:14:32
#> Snapshots: 1
#>
#> # Label Rows Cols NAs Type
#> ─ ───── ──── ──── ─── ────
#> 1 raw 32 11 0 tap