type_alike: Compare Types of Objects

View source: R/type.R

type_alikeR Documentation

Compare Types of Objects

Description

By default, checks type_of() objects and two objects are considered type_alike if they have the same type. There is special handling for integers, numerics, and functions.

Usage

type_alike(target, current, settings = NULL)

Arguments

target

the object to test type alikeness against

current

the object to test the type alikeness of

settings

NULL, or a list as produced by vetr_settings()

Details

For integers and numerics, if current is integer or integer-like (e.g. 1.0) it will match real or integer target values. Closures, built-ins, and specials are all treated as type function.

Specific behavior can be tuned with the type.mode parameter to the vetr_settings() object passed as the settings parameter to this function.

See Also

type_of, alike, vetr_settings(), in particular the section about the type.mode parameter which affects how this function behaves.


vetr documentation built on June 22, 2024, 12:07 p.m.