as_tbl: Convert a duckplyr frame to a dbplyr table

View source: R/as_tbl.R

as_tblR Documentation

Convert a duckplyr frame to a dbplyr table

Description

[Experimental]

This function converts a lazy duckplyr frame or a data frame to a dbplyr table in duckplyr's internal connection. This allows using dbplyr functions on the data, including hand-written SQL queries. Use as_duckdb_tibble() to convert back to a lazy duckplyr frame.

Usage

as_tbl(.data)

Arguments

.data

A lazy duckplyr frame or a data frame.

Value

A dbplyr table.

Examples


df <- duckdb_tibble(a = 1L)
df

tbl <- as_tbl(df)
tbl

tbl %>%
  mutate(b = sql("a + 1")) %>%
  as_duckdb_tibble()


duckplyr documentation built on June 8, 2025, 10:53 a.m.