type_of: A Fuzzier Version of 'typeof()'

Description Usage Arguments Value Examples

View source: R/type.R

Description

Numerics that are equivalent to integers (e.g x == floor(x)) are classified as integers, and builtin and special functions are reported as closures.

Usage

1
type_of(object)

Arguments

object

the object to check the type of

Value

character(1L) the type of the object

Examples

1
2
3
4
5
type_of(1.0001)          # numeric
type_of(1.0)             # integer (`typeof` returns numeric)
type_of(1)               # integer (`typeof` returns numeric)
type_of(sum)             # closure (`typeof` returns builtin)
type_of(`$`)             # closure (`typeof` returns special)

vetr documentation built on May 3, 2021, 5:08 p.m.