comparable_help: Are Objects Comparable?

View source: R/comparable.R

comparable_helpR Documentation

Are Objects Comparable?

Description

Determines whether modes of arguments are comparable (i.e., sortable and compatible with each other), meaning that the are either all character, all logical, all numeric, or all ordered factor with the same set of levels (in the same order).

Usage

comparable_help()

comparable(..., .rec = FALSE)

comparable_xy(x, y, rec = FALSE)

Arguments

...

An arbitrary number of arguments to be checked for comparability with each other.

x, y

Arguments to be checked for comparability.

rec, .rec

TRUE or FALSE indicating whether ... arguments must be recyclable to be comparable.

Value

A logical scalar.

Functions

  • comparable(): Check an arbitrary number of ... arguments for comparability. Also checks for mutual recyclability when .rec = TRUE.

  • comparable_xy(): Checks x and y for comparability. Also checks for mutual recyclability when rec = T.

Examples

az. <- letters
comparable(1:10, pi, exp(1))
comparable(az., az., "", "!")
comparable(az., factor(az.))
comparable(1:10, 1:3, rec. = TRUE)
comparable(list(az., 1:10), az., 1:10)
comparable(factor(az., az., ordered = T), factor("q", az., ordered = T))

j-martineau/uj documentation built on Sept. 14, 2024, 4:40 a.m.