Array base type. Immutable data array with some logical type and some length.

Factory

The Array$create() factory method instantiates an Array and takes the following arguments:

  • x: an R vector, list, or data.frame

  • type: an optional data type for x. If omitted, the type will be inferred from the data.

Usage

a <- Array$create(x)
length(a)

print(a)
a == a

Methods

  • $IsNull(i): Return true if value at index is null. Does not boundscheck

  • $IsValid(i): Return true if value at index is valid. Does not boundscheck

  • $length(): Size in the number of elements this array contains

  • $offset(): A relative position into another array's data, to enable zero-copy slicing

  • $null_count(): The number of null entries in the array

  • $type(): logical type of data

  • $type_id(): type id

  • $Equals(other) : is this array equal to other

  • $ApproxEquals(other) :

  • $data(): return the underlying ArrayData

  • $as_vector(): convert to an R vector

  • $ToString(): string representation of the array

  • $Slice(offset, length = NULL): Construct a zero-copy slice of the array with the indicated offset and length. If length is NULL, the slice goes until the end of the array.

  • $Take(i): return an Array with values at positions given by integers (R vector or Array Array) i.

  • $Filter(i): return an Array with values at positions where logical vector (or Arrow boolean Array) i is TRUE.

  • $RangeEquals(other, start_idx, end_idx, other_start_idx) :

  • $cast(target_type, safe = TRUE, options = cast_options(safe)): Alter the data in the array to change its type.

  • $View(type): Construct a zero-copy view of this array with the given type.

  • $Validate() : Perform any validation checks to determine obvious inconsistencies within the array's internal data. This can be an expensive check, potentially O(length)

Super class

arrow::Object -> Array

Methods

Public methods

Inherited methods

Method IsNull()

Usage

Array$IsNull(i)


Method IsValid()

Usage

Array$IsValid(i)


Method length()

Usage

Array$length()


Method type_id()

Usage

Array$type_id()


Method Equals()

Usage

Array$Equals(other)


Method ApproxEquals()

Usage

Array$ApproxEquals(other)


Method data()

Usage

Array$data()


Method as_vector()

Usage

Array$as_vector()


Method ToString()

Usage

Array$ToString()


Method Slice()

Usage

Array$Slice(offset, length = NULL)


Method Take()

Usage

Array$Take(i)


Method Filter()

Usage

Array$Filter(i)


Method RangeEquals()

Usage

Array$RangeEquals(other, start_idx, end_idx, other_start_idx)


Method cast()

Usage

Array$cast(target_type, safe = TRUE, options = cast_options(safe))


Method View()

Usage

Array$View(type)


Method Validate()

Usage

Array$Validate()


Method clone()

The objects of this class are cloneable with this method.

Usage

Array$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.