as_arrow_array() 函数与 Array$create() 完全相同,不同之处在于它是一个 S3 泛型,允许在其他包中定义方法以将对象转换为 Array。 Array$create() 速度稍快,因为它会尝试在 C++ 中进行转换,然后再回退到 as_arrow_array()。
用法
as_arrow_array(x, ..., type = NULL)
# S3 method for class 'Array'
as_arrow_array(x, ..., type = NULL)
# S3 method for class 'Scalar'
as_arrow_array(x, ..., type = NULL)
# S3 method for class 'ChunkedArray'
as_arrow_array(x, ..., type = NULL)参数
- x
要转换为 Arrow 数组的对象
- ...
传递给 S3 方法
- type
最终数组的 类型。
NULL值将默认为infer_type()猜测的类型。
值
类型为 type 的 Array。