type_alike

0th

Percentile

Compare Types of Objects

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.

Aliases
  • type_alike
Documentation reproduced from package vetr, version 0.2.7, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.