These functions create type objects corresponding to Arrow types. Use them
when defining a schema()
or as inputs to other types, like struct
. Most
of these functions don't take arguments, but a few do.
int8()int16()
int32()
int64()
uint8()
uint16()
uint32()
uint64()
float16()
halffloat()
float32()
float()
float64()
boolean()
bool()
utf8()
large_utf8()
binary()
large_binary()
fixed_size_binary(byte_width)
string()
date32()
date64()
time32(unit = c("ms", "s"))
time64(unit = c("ns", "us"))
null()
timestamp(unit = c("s", "ms", "us", "ns"), timezone = "")
decimal(precision, scale)
list_of(type)
large_list_of(type)
fixed_size_list_of(type, list_size)
struct(...)
byte width for FixedSizeBinary
type.
For time/timestamp types, the time unit. time32()
can take
either "s" or "ms", while time64()
can be "us" or "ns". timestamp()
can
take any of those four values.
For timestamp()
, an optional time zone string.
For decimal()
, precision
For decimal()
, scale
For list_of()
, a data type to make a list-of-type
list size for FixedSizeList
type.
For struct()
, a named list of types to define the struct columns
An Arrow type object inheriting from DataType.
A few functions have aliases:
utf8()
and string()
float16()
and halffloat()
float32()
and float()
bool()
and boolean()
Called from schema()
or struct()
, double()
also is supported as a
way of creating a float64()
date32()
creates a datetime type with a "day" unit, like the R Date
class. date64()
has a "ms" unit.
dictionary()
for creating a dictionary (factor-like) type.
# NOT RUN {
bool()
struct(a = int32(), b = double())
timestamp("ms", timezone = "CEST")
time64("ns")
# }
Run the code above in your browser using DataLab