btwrite: Write a data frame to a delimited text file

View source: R/read-delim.R

btwriteR Documentation

Write a data frame to a delimited text file

Description

A threaded C++ writer: each column is resolved to a plain C array on the R thread, then disjoint row ranges are formatted into private buffers and flushed in order.

Usage

btwrite(
  x,
  file,
  delim = ",",
  na = "NA",
  col_names = TRUE,
  quote = "\"",
  digits = 15,
  append = FALSE,
  n_threads = bt_default_threads()
)

Arguments

x

A data.frame.

file

Output path.

delim

Field delimiter.

na

String to write for NA.

col_names

Logical; write a header row?

quote

Quoting character; a field is quoted only if it contains the delimiter, the quote character, or a newline.

digits

Significant digits for double columns (passed to ⁠%g⁠).

append

Logical; append to file instead of overwriting (no header is written when appending).

n_threads

Number of worker threads.

Value

file, invisibly.

Examples

p <- tempfile(fileext = ".csv")
btwrite(head(iris), p)
btread(p)

basetable documentation built on Sept. 18, 2026, 9:13 a.m.