Skip to contents

Returns a list containing the fields of a wrapper object

Usage

wrapper_details(x)

Arguments

x

Any R object belonging with a wrap ALTREP class

Value

A list with the following entries:

  • contents: Any R object. The underlying object being wrapped

  • has_na: Logical scalar. TRUE if contents might contain NA, or FALSE if it definitely doesn't.

  • is_sorted: Logical scalar. TRUE if contents is sorted in any order

  • descending: Logical scalar. TRUE if contents is sorted in descending order, FALSE if it is sorted in ascending order, or NA if it isn't sorted or its sorting status is unknown.

  • na_first Logical scalar. TRUE if contents is sorted in an order that puts NA values first, FALSE if it is sorted last, or NA if contents is unsorted or its sorting status is unknown

Examples

sort(5:1) |> wrapper_details()
#> $contents
#> [1] 1 2 3 4 5
#> 
#> $has_na
#> [1] FALSE
#> 
#> $is_sorted
#> [1] TRUE
#> 
#> $descending
#> [1] FALSE
#> 
#> $na_first
#> [1] FALSE
#>