is_sortable: Checks whether a vector or list is sortable

View source: R/sftime.R

is_sortableR Documentation

Checks whether a vector or list is sortable

Description

Checks whether a vector or list is sortable. This is the condition for a vector to be usable as time column in a sftime object.

Usage

is_sortable(x)

Arguments

x

The object to check.

Details

Checks whether the provided object can be handled by order. A couple of basic types are whitelisted. However, custom types can be defined when they provide a dedicated generic to xtfrm. Note that a list can only be sorted with atomic values. See the examples below for a template.

Value

TRUE if x passes the check, else FALSE.

Examples

x <- Sys.time() + 5:1 * 3600 * 24
sort(x)
is_sortable(x)


sftime documentation built on March 18, 2022, 7:11 p.m.