powered by
Writes model-ready data to disk from either a `PubChemModelMatrix` object or a tabular object.
pc_export_model_data( x, path, format = c("csv", "rds"), include_ids = TRUE, include_outcome = TRUE )
Invisibly returns a list with `path`, `format`, and output dimensions.
Input object. Supported: - `PubChemModelMatrix` - `data.frame`/`tibble`
Output path.
Export format, one of `"csv"` or `"rds"`.
Logical. Include ID columns from `PubChemModelMatrix`.
Logical. Include outcome vector from `PubChemModelMatrix`.
Output format is selected by `format`; `csv` is written with `utils::write.csv()` and `rds` with `saveRDS()`.
out_file <- tempfile(fileext = ".csv") x <- tibble::tibble(CID = c("1", "2"), x1 = c(0.1, 0.2)) meta <- pc_export_model_data(x, path = out_file, format = "csv") file.exists(meta$path)
Run the code above in your browser using DataLab