| ddbs_register_table | R Documentation |
This function registers a Simple Features (SF) object as a temporary Arrow-backed
view in a DuckDB database. This is a zero-copy operation and is significantly
faster than ddbs_write_table for workflows that do not require data to be
permanently materialized in the database.
ddbs_register_table(conn, data, name, overwrite = FALSE, quiet = FALSE)
conn |
A |
data |
A |
name |
A character string of length one specifying the name of the table,
or a character string of length two specifying the schema and table
names. If |
overwrite |
Boolean. whether to overwrite the existing table if it exists. Defaults
to |
quiet |
A logical value. If |
TRUE (invisibly) on successful registration.
## Not run:
library(duckdb)
library(duckspatial)
library(sf)
conn <- ddbs_create_conn("memory")
nc <- st_read(system.file("shape/nc.shp", package="sf"), quiet = TRUE)
ddbs_register_table(conn, nc, "nc_arrow_view")
dbGetQuery(conn, "SELECT COUNT(*) FROM nc_arrow_view;")
ddbs_stop_conn(conn)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.