Skip to main content

R

R is a language for statistical analysis.

To connect to MotherDuck from an R program, you need to first install DuckDB:

install.packages("duckdb")

Once DuckDB package is installed, any syntax described in the DuckDB's documentation should work against dbdir = "md:" style connections.

For example:

library("DBI")
con <- dbConnect(duckdb::duckdb(), dbdir = "md:")

res <- dbGetQuery(con, "SHOW DATABASES")
print(res)

Considerations and limitations

MacOS integration

MotherDuck integration does not currently work on MacOS due to a linking issue. Symptoms: symbol not found in flat namespace '__ZTIN6duckdb9ExceptionE'