Save Fetched Data to Multiple Formats

save_data(df, filename = NULL, format = "rds")

Arguments

df

Data frame to save (with fetch_info attribute for auto-naming).

filename

Required. A non-empty string (without extension) must be provided.

format

Output format: "rds", "csv", or "xlsx". Default "rds".

Value

Full file path (invisibly).

Examples

# \donttest{
  my_data <- fetch_bddk1(2024, 1, 15)
  temp_file <- tempfile() # filename should be without extension
  save_data(my_data, temp_file, format = "csv")
#> Data saved to /tmp/RtmpPGXZW7/file1b075b393b5a.csv
# }