as_arrow_array function

Convert an object to an Arrow Array

Convert an object to an Arrow Array

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().

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().

Returns

An Array with type type.

Examples

as_arrow_array(1:5)
  • Maintainer: Jonathan Keane
  • License: Apache License (>= 2.0)
  • Last published: 2025-02-26