R: Comparison proxy

vec_proxy_compare {vctrs} | R Documentation

## Comparison proxy

### Description

Returns a proxy object (i.e. an atomic vector or data frame of atomic vectors). For vctrs, this determines the behaviour of `order()` and `sort()` (via `xtfrm()`); `<`, `>`, `>=` and `<=` (via `vec_compare()`); and `min()`, `max()`, `median()`, and `quantile()`.

### Usage

    vec_proxy_compare(x, ..., relax = FALSE)

### Arguments

`x` | A vector x.
`...` | These dots are for future extensions and must be empty.
`relax` | If `TRUE`, and `x` is otherwise non-comparable, will return `vec_seq_along(x)`. This allows a data frame to be orderable, even if one of its components is not. This is experimental and may change in the future.

### Details

The default method assumes that all classes built on top of atomic vectors or records are orderable. If your class is not, you will need to provide a `vec_proxy_compare()` method that throws an error.

### Value

A 1d atomic vector or a data frame.

[Package vctrs version 0.2.2 Index]