Create a DuckLake table
Arguments
- data_source
Raw data source. Can be:
A URL (http:// or https://)
A file path (e.g., "data.csv", "data.parquet")
An R data.frame or tibble
A lazy table (tbl_duckdb_connection or tbl_lazy)
- table_name
Name of the new table
- labels
When
TRUE(the default) and the data has haven/labelled variable labels (labelattributes on columns), store them in the lake as column comments – in the same transaction as the table creation, so both land as one snapshot. Collecting the table later restores the labels (seeget_table_comments()), and every other client of the lake can read them too. Set toFALSEto skip.
See also
Other table operations:
add_data_files(),
create_view(),
drop_view(),
ducklake_exec(),
get_ducklake_table(),
get_metadata_table(),
list_ducklake_tables(),
replace_table(),
show_ducklake_query()
Examples
if (FALSE) { # \dontrun{
# From URL
create_table("https://example.com/data.csv", "my_table")
# From local file
create_table("data.csv", "my_table")
# From data.frame
create_table(mtcars, "my_table")
# From lazy table (pipe-friendly)
get_ducklake_table("source_table") %>%
filter(x > 5) %>%
create_table("filtered_table")
} # }
