Create an Arrow Table
Arguments
- ...
A
data.frameor a named set of Arrays or vectors. If given amixture of data.frames and named vectors, the inputs will be autospliced together(see examples). Alternatively, you can provide a single Arrow IPCInputStream,Message,Buffer, or Rrawobject containing aBuffer.- schema
aSchema, or
NULL(the default) to infer the schema fromthe data in.... When providing an Arrow IPC buffer,schemais required.
Examples
tbl<-arrow_table(name=rownames(mtcars),mtcars)dim(tbl)#> [1] 32 12dim(head(tbl))#> [1] 6 12names(tbl)#> [1] "name" "mpg" "cyl" "disp" "hp" "drat" "wt" "qsec" "vs" "am"#> [11] "gear" "carb"tbl$mpg#> ChunkedArray#> <double>#> [#> [#> 21,#> 21,#> 22.8,#> 21.4,#> 18.7,#> 18.1,#> 14.3,#> 24.4,#> 22.8,#> 19.2,#> ...#> 15.2,#> 13.3,#> 19.2,#> 27.3,#> 26,#> 30.4,#> 15.8,#> 19.7,#> 15,#> 21.4#> ]#> ]tbl[["cyl"]]#> ChunkedArray#> <double>#> [#> [#> 6,#> 6,#> 4,#> 6,#> 8,#> 6,#> 8,#> 4,#> 4,#> 6,#> ...#> 8,#> 8,#> 8,#> 4,#> 4,#> 4,#> 8,#> 6,#> 8,#> 4#> ]#> ]as.data.frame(tbl[4:8,c("gear","hp","wt")])#> gear hp wt#> 1 3 110 3.215#> 2 3 175 3.440#> 3 3 105 3.460#> 4 3 245 3.570#> 5 4 62 3.190