`setBigData()` declares the data source that a myIO widget should use for large-dataset rendering and linked-selection coordination.
Arguments
- widget
A myIO htmlwidget object.
- source
A supported big-data source: a `data.frame`, an Arrow table or record-batch reader, a single file path or URL ending in `.parquet`, `.arrow`, `.feather`, or `.csv`, or a `DBIConnection`.
- rowkeyCol
Optional name of the column that uniquely identifies rows for Crosstalk-compatible linked selections.
- ...
Additional source-specific options. Also accepts the deprecated
rowkey_colalias forrowkeyCol. For DBI sources, pass `table = "name"` so myIO can query the table schema. For file path or URL sources, pass `schema = c("col1", "col2", ...)` or a schema field list.
Details
This function writes the `x.bigdata.*` payload fields consumed by the widget's large-dataset virtualization path and follows its row-key contract. DBI sources are stored as an internal session-scoped marker in `x.bigdata$dbi_handle_internal`; render-time source registration is handled by the source registry phase.
Examples
# \donttest{
myIO(data = mtcars) |>
setBigData(mtcars)
myIO() |>
setBigData("data/large.parquet", schema = c("id", "x", "y"), rowkeyCol = "id")
if (requireNamespace("duckdb", quietly = TRUE)) {
con <- DBI::dbConnect(duckdb::duckdb())
obs <- data.frame(id = seq_len(nrow(mtcars)), mpg = mtcars$mpg)
DBI::dbWriteTable(con, "observations", obs)
myIO() |>
setBigData(con, table = "observations", rowkeyCol = "id")
DBI::dbDisconnect(con, shutdown = TRUE)
}
# }
