Summary
In this chapter, we went through the DuckDB R API, covering all the aspects that are required so that you can start using DuckDB effectively in your R data analysis workflow.
After making sure that we had an environment up and running to work with R and DuckDB, we went through how to interact with DuckDB via the R DBI package, which included connecting to DuckDB, reading and writing tables to and from dataframes, querying DuckDB tables and executing SQL statements, using prepared statements, and disconnecting from DuckDB. We then looked at registering dataframes and Arrow tables as virtual tables in DuckDB’s catalog, allowing us to query these R data structures directly from DuckDB. We finished off by looking at how we can leverage the dplyr interface for effective data manipulation, using it to query dataframes produced by DuckDB as well as querying DuckDB directly using the dbplyr backend, which converts dplyr code into SQL queries.
With that, you know about...