Skip to contents

ALTREP objects have two data slots, both of which can hold any R type. The exact meaning of each slot can depend entirely on the ALTREP class and how it wants to represent data.

Usage

alt_data2(x)

Arguments

x

An ALTREP object of any class

Value

Possibly any R object, including NULL

Details

Although the exact meaning of each slot is flexible, a convention used in R core is for data1 to hold the "compressed" state of a type, and for data2 to hold the "expanded" state. See the vignette("altrepr") for more information.

Note

Warning: storing the result will cause an R session crash with a deferred_string ALTREP object.

Examples

sort(3:1) |> alt_data2()
#> [1] 1 1