跳到內容

CSV 寫入選項

用法

csv_write_options(
  include_header = TRUE,
  batch_size = 1024L,
  null_string = "",
  delimiter = ",",
  eol = "\n",
  quoting_style = c("Needed", "AllValid", "None")
)

參數

include_header

是否寫入包含欄位名稱的初始標頭行

batch_size

一次處理的最大列數。

null_string

要為空值寫入的字串。不得包含引號。

delimiter

欄位分隔符

eol

用於結束列的行尾字元

quoting_style

如何處理引號。「Needed」(僅將需要引號的值括在引號中,因為它們的 CSV 呈現可以包含引號本身,例如字串或二進位值)、「AllValid」(將所有有效值括在引號中)或「None」(不要將任何值括在引號中)。

範例

tf <- tempfile()
on.exit(unlink(tf))
write_csv_arrow(airquality, tf, write_options = csv_write_options(null_string = "-99"))