Scalar {arrow}R Documentation

Arrow scalars

Description

A Scalar holds a single value of an Arrow type.

Factory

The Scalar$create() factory method instantiates a Scalar and takes the following arguments:

Usage

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

print(a)
a == a

Methods

Examples

Scalar$create(pi)
Scalar$create(404)
# If you pass a vector into Scalar$create, you get a list containing your items
Scalar$create(c(1, 2, 3))

# Comparisons
my_scalar <- Scalar$create(99)
my_scalar$ApproxEquals(Scalar$create(99.00001)) # FALSE
my_scalar$ApproxEquals(Scalar$create(99.000009)) # TRUE
my_scalar$Equals(Scalar$create(99.000009)) # FALSE
my_scalar$Equals(Scalar$create(99L)) # FALSE (types don't match)

my_scalar$ToString()

[Package arrow version 16.1.0 Index]