跳到內容

雖然 arrow_table() 從一個或多個欄位建構表格,但 as_arrow_table() 將單一物件轉換為 Arrow Table

用法

as_arrow_table(x, ..., schema = NULL)

# Default S3 method
as_arrow_table(x, ...)

# S3 method for class 'Table'
as_arrow_table(x, ..., schema = NULL)

# S3 method for class 'RecordBatch'
as_arrow_table(x, ..., schema = NULL)

# S3 method for class 'data.frame'
as_arrow_table(x, ..., schema = NULL)

# S3 method for class 'RecordBatchReader'
as_arrow_table(x, ...)

# S3 method for class 'Dataset'
as_arrow_table(x, ...)

# S3 method for class 'arrow_dplyr_query'
as_arrow_table(x, ...)

# S3 method for class 'Schema'
as_arrow_table(x, ...)

引數

x

要轉換為 Arrow 表格的物件

...

傳遞給 S3 方法

schema

一個 Schema,或 NULL (預設值) 從 ... 中的資料推斷 schema。當提供 Arrow IPC 緩衝區時,schema 是必要的。

一個 Table

範例

# use as_arrow_table() for a single object
as_arrow_table(data.frame(col1 = 1, col2 = "two"))
#> Table
#> 1 rows x 2 columns
#> $col1 <double>
#> $col2 <string>
#> 
#> See $metadata for additional Schema metadata

# use arrow_table() to create from columns
arrow_table(col1 = 1, col2 = "two")
#> Table
#> 1 rows x 2 columns
#> $col1 <double>
#> $col2 <string>