Makes a custom wrapper ALTREP
Arguments
- x
Any R object to wrap
- has_na
Logical scalar.
FALSEifxshould be considered to be free ofNAvalues, otherwise should be set toTRUE- is_sorted
Logical scalar.
TRUEifxshould be considered sorted,FALSEif it should be considered unsorted, orNAif its sorted status is unknown- descending
Logical scalar.
TRUEifxshould be considered to be sorted in descending order,FALSEfor ascending order. Ifxis unsorted this is unused.- na_first
Logical scalar.
TRUEifxshould be treated as if it hasNAvalues at the start of the vector,FALSEif they are at the end. Ifxis unsorted this is unused.
Examples
wrapper <- wrapper_make(c(5, 3, NA, 1), is_sorted = TRUE, has_na = FALSE)
wrapper_details(wrapper)
#> $contents
#> [1] 5 3 NA 1
#>
#> $has_na
#> [1] FALSE
#>
#> $is_sorted
#> [1] TRUE
#>
#> $descending
#> [1] FALSE
#>
#> $na_first
#> [1] FALSE
#>