Learn R Programming

TrialEmulation (version 0.0.4.2)

save_to_csv: Save expanded data as CSV

Description

[Experimental]

Usage

save_to_csv(path)

Value

A te_datastore_csv object.

Arguments

path

Directory to save CSV files in. Must be empty.

See Also

Other save_to: save_to_datatable(), save_to_duckdb(), set_expansion_options()

Examples

Run this code
csv_dir <- file.path(tempdir(), "expanded_trials_csv")
dir.create(csv_dir)
csv_datastore <- save_to_csv(path = csv_dir)

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

# Delete directory after use
unlink(csv_dir)

Run the code above in your browser using DataLab