as_arrow_array: Convert an object to an Arrow Array

View source: R/array.R

as_arrow_arrayR Documentation

Convert an object to an Arrow Array

Description

The as_arrow_array() function is identical to Array$create() except that it is an S3 generic, which allows methods to be defined in other packages to convert objects to Array. Array$create() is slightly faster because it tries to convert in C++ before falling back on as_arrow_array().

Usage

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)

Arguments

x

An object to convert to an Arrow Array

...

Passed to S3 methods

type

A type for the final Array. A value of NULL will default to the type guessed by infer_type().

Value

An Array with type type.

Examples

as_arrow_array(1:5)


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