Skip to content

Create Array DataType

Source code

Description

The Array and List datatypes are very similar. The only difference is that sub-arrays all have the same length while sublists can have different lengths. Array methods can be accessed via the $arr subnamespace.

Usage

DataType_Array(datatype = "unknown", width)

Arguments

datatype An inner DataType. The default is “Unknown” and is only a placeholder for when inner DataType does not matter, e.g. as used in example.
width The length of the arrays.

Value

An array DataType with an inner DataType

Examples

library(polars)

# basic Array
pl$Array(pl$Int32, 4)
#> DataType: Array(
#>     Int32,
#>     4,
#> )
# some nested Array
pl$Array(pl$Array(pl$Boolean, 3), 2)
#> DataType: Array(
#>     Array(
#>         Boolean,
#>         3,
#>     ),
#>     2,
#> )