save_table()
Save a table to the outputs directory
Saves a data frame or tibble to the configured tables directory. The directory is created lazily on first use.
Usage
save_table(data, name, format = "csv", public = FALSE, overwrite = TRUE, ...)
Arguments
| Name | Description |
|---|---|
| data |
A data frame, tibble, or other tabular data |
| name |
The name for the output file (without extension) |
| format |
Output format: "csv" (default), "rds", "xlsx", or "parquet" |
| public |
If TRUE, saves to public outputs directory (for project_sensitive type) |
| overwrite |
If TRUE, overwrites existing files (default: TRUE) |
| ... |
Additional arguments passed to the underlying write function |
Value
The path to the saved file (invisibly)
Examples
if (FALSE) {
# Save a simple table
save_table(my_results, "regression_results")
# Save as Excel
save_table(my_results, "regression_results", format = "xlsx")
# Save to public directory (for sensitive projects)
save_table(summary_stats, "summary", public = TRUE)
}