Skip to contents

Save expanded data to DuckDB

Usage

save_to_duckdb(path)

Arguments

path

Directory to save DuckDB database file in.

Value

A te_datastore_duckdb object.

See also

Examples

if (require(duckdb)) {
  duckdb_dir <- file.path(tempdir(), "expanded_trials_duckdb")

  trial_to_expand <- trial_sequence("ITT") |>
    set_data(data = data_censored) |>
    set_expansion_options(output = save_to_duckdb(path = duckdb_dir), chunk_size = 500)

  # Delete directory after use
  unlink(duckdb_dir)
}
#> Loading required package: duckdb
#> Loading required package: DBI