Codync
무료 오픈소스 1:1 대안, Grok Bot과 Muse 대신
R과 Apache Arrow 컬럼 간 이동, 메모리 C 인터페이스와 IPC 스트림·파일 포맷 지원
Moves columns between R and the Apache Arrow columnar format: the C data interface in memory and the inter-process communication (IPC) stream and file formats on disk. Every Arrow type converts to an
개발 도구GitHub @pedrobtz온라인운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
저장소 정보는 아직 수집하지 않았습니다.
아직 감지된 업데이트가 없습니다. GitHub 릴리스가 나오면 여기에 보입니다.
Moves columns between R and the Apache Arrow columnar format: the C data interface in memory and the inter-process communication (IPC) stream and file formats on disk. Every Arrow type converts to an R vector and back, and a conversion either keeps every value unchanged or raises an error that names the column and the R type that would hold it exactly. A registry lets other packages declare which R class is the exact form of which Arrow type. Handles share the layout of the nanoarrow package, so
저장소 README에서 가져옴
README 전체를 불러오는 중입니다.
README 전문 보기 ↗DuckDB, Polars, ADBC drivers, pyarrow and the arrow package all hand
data around as Apache Arrow columns. R has
no exact form for several of Arrow’s types: a 64-bit integer past 2^53,
a decimal128, a nanosecond timestamp. The usual bridges convert them
to a double anyway, and the change goes unnoticed until a join key no
longer matches.
zuarrow moves columns between R and Arrow on one rule: a value crosses exactly, or the call fails, naming the column and the R type that would hold it.
lossy = "error" is the default everywhere. Ask
for the exact text, the nearest R type with a warning, or the nearest
R type silently, but only by asking.arrow_register(), and from then on that column
converts exactly.arrow_read() and arrow_write() handle the
file (.arrow, Feather version 2) and the stream (.arrows), with
LZ4 and zstd bodies decompressed by
zukomp, so a compressed file
opens on every machine.zuarrow is not on CRAN yet. Install the development version from GitHub:
# install.packages("pak")
pak::pak("pedrobtz/zuarrow")
library(zuarrow)
Ordinary columns cross both ways unchanged, factors and dates included.
df <- data.frame(
id = 1:3,
city = factor(c("Lisbon", "Porto", "Lisbon")),
day = as.Date("2026-10-21") + 0:2
)
identical(arrow_to_r(arrow_array(df)), df)
#> [1] TRUE
A 64-bit integer that a double cannot hold is an error, not a rounding.
big <- arrow_array(c("9007199254740993", "1"), schema = "l")
arrow_to_r(big)
#> Error in `arrow_to_r()`:
#> ! Column 1 (Arrow format `l`) can't be converted to R exactly: row 1 holds 9007199254740993. Load zuint to read it exactly, or use `lossy = "character"` for its exact text, or `lossy = "allow"` to accept the loss.
lossy = "character" gives the exact text, which writes back to the
same type.
text <- arrow_to_r(big, lossy = "character")
text
#> [1] "9007199254740993" "1"
#> attr(,"arrow_type")
#> [1] "l"
arrow_equal(arrow_array(text), big)
#> [1] TRUE
The IPC formats are one call each way, with compression on request.
path <- tempfile(fileext = ".arrow")
arrow_write(df, path, compression = "zstd")
arrow_read(path)
#> id city day
#> 1 1 Lisbon 2026-10-21
#> 2 2 Porto 2026-10-22
#> 3 3 Lisbon 2026-10-23
Apart from zuarrow_info(), every function is prefixed arrow_. Each
takes or returns a handle or a plain R object. zuarrow’s own errors
inherit from zuarrow_error, with a class for each kind, such as
zuarrow_lossy_error.
arrow_types() prints the type table.zuarrow bundles the nanoarrow C library and is checked against apache/arrow-testing’s IPC golden files and crash corpus, and against the arrow package.