% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/audit-export.R
\name{trail_to_df}
\alias{trail_to_df}
\title{Convert an Audit Trail to a Data Frame}
\usage{
trail_to_df(.trail)
}
\arguments{
\item{.trail}{An \code{\link[=audit_trail]{audit_trail()}} object.}
}
\value{
A \code{data.frame} with columns \code{index}, \code{label}, \code{type}, \code{timestamp},
\code{nrow}, \code{ncol}, \code{total_nas}, \code{all_columns}, \code{schema}, \code{numeric_summary},
\code{changes}, \code{diagnostics}, \code{custom}, \code{pipeline}, and \code{controls}. Trail
\code{name} and \code{created_at} are stored as attributes \code{"trail_name"} and
\code{"created_at"}.
}
\description{
Returns a plain \code{data.frame} with one row per snapshot. Nested fields
(\code{all_columns}, \code{schema}, \code{numeric_summary}, \code{changes}, \code{diagnostics},
\code{custom}, \code{pipeline}, \code{controls}) become list-columns. Trail metadata is
stored as attributes on the result.
}
\examples{
trail <- audit_trail("example")
mtcars |> audit_tap(trail, "raw")
dplyr::filter(mtcars, mpg > 20) |> audit_tap(trail, "filtered")
df <- trail_to_df(trail)
print(df)
attr(df, "trail_name")

}
\seealso{
Other audit export:
\code{\link[=audit_export]{audit_export()}},
\code{\link[=read_trail]{read_trail()}},
\code{\link[=trail_to_list]{trail_to_list()}},
\code{\link[=write_trail]{write_trail()}}
}
\concept{audit export}
