Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ChunkedArray

ChunkedArray class


Description

A ChunkedArray is a data structure managing a list of primitive Arrow Arrays logically as one large array. Chunked arrays may be grouped together in a Table.

Usage

chunked_array(..., type = NULL)

Arguments

...

Vectors to coerce

type

currently ignored

Factory

The ChunkedArray$create() factory method instantiates the object from various Arrays or R vectors. chunked_array() is an alias for it.

Methods

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

  • $chunk(i): Extract an Array chunk by integer position

  • $as_vector(): convert to an R vector

  • $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 a ChunkedArray with values at positions given by integers i. If i is an Arrow Array or ChunkedArray, it will be coerced to an R vector before taking.

  • $Filter(i, keep_na = TRUE): return a ChunkedArray with values at positions where logical vector or Arrow boolean-type (Chunked)Array i is TRUE.

  • $SortIndices(descending = FALSE): return an Array of integer positions that can be used to rearrange the ChunkedArray in ascending or descending order

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

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

  • $chunks(): return a list of Arrays

  • $num_chunks(): integer number of chunks in the ChunkedArray

  • $type(): logical type of data

  • $View(type): Construct a zero-copy view of this ChunkedArray 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)

See Also


arrow

Integration to 'Apache' 'Arrow'

v4.0.0.1
Apache License (>= 2.0)
Authors
Neal Richardson [aut, cre], Ian Cook [aut], Jonathan Keane [aut], Romain François [aut] (<https://orcid.org/0000-0002-2444-4226>), Jeroen Ooms [aut], Javier Luraschi [ctb], Jeffrey Wong [ctb], Apache Arrow [aut, cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.