to_arrow: Create an Arrow object from others

View source: R/duckdb.R

to_arrowR Documentation

Create an Arrow object from others

Description

This can be used in pipelines that pass data back and forth between Arrow and other processes (like DuckDB).

Usage

to_arrow(.data)

Arguments

.data

the object to be converted

Value

A RecordBatchReader.

Examples


library(dplyr)

ds <- InMemoryDataset$create(mtcars)

ds %>%
  filter(mpg < 30) %>%
  to_duckdb() %>%
  group_by(cyl) %>%
  summarize(mean_mpg = mean(mpg, na.rm = TRUE)) %>%
  to_arrow() %>%
  collect()


arrow documentation built on Dec. 6, 2022, 5:10 p.m.