This high‑level wrapper writes an aniframe object to a file in one of the
supported formats (parquet, csv, or tsv). We highly recommend using parquet
as neither csv or tsv can preserve the metadata.
Arguments
- data
An aniframe object (see
anicore::is_aniframe()).- filename
Character string specifying the output file name. The file extension determines which writer is used.
- ...
Additional arguments passed to the format‑specific writer (
write_aniframe_csv()orwrite_aniframe_parquet()). Typical arguments includedelim,col_names,compression, etc., depending on the backend.
Details
Supported extensions are
"parquet","csv"and"tsv". We highly recommend usingparquetas neithercsvortsvcan preserve the metadata.CSV/TSV files are written with vroom for fast I/O:
.csvcomma-separated and.tsvtab-separated, unlessdelimis passed.Parquet files are written with the arrow package is installed (install‑on‑demand if missing).
Examples
## Create a small aniframe for demonstration
df <- anicore::example_anipoint()
## Write the aniframe as CSV
write_aniframe(df, tempfile(fileext = ".csv"))
#> Warning: csv files do not preserve metadata. We highly recommend saving in `parquet`
#> format to preserve all metadata.
## Write the same aniframe as Parquet
write_aniframe(df, tempfile(fileext = ".parquet"))