type_alike: Compare Types of Objects

Description Usage Arguments Details See Also

View source: R/type.R

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

1
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 May 3, 2021, 5:08 p.m.