typeof {base}R Documentation

The Type of an Object

Description

typeof determines the (R internal) type or storage mode of any object

Usage

typeof(x)

Arguments

x any R object.

Value

A character string. The possible values are listed in the structure TypeTable in ‘src/main/util.c’. Current values are the vector types "logical", "integer", "double", "complex", "character", "raw" and "list", "NULL", "closure" (function), "special" and "builtin" (basic functions and operators), "environment", and others that are unlikely to be seen at user level ("symbol", "pairlist", "promise", "language", "char", "...", "any", "expression", "externalptr", "bytecode" and "weakref").
As from R 2.4.0, "S4" can occur to refer to some objects with formal (S4) classes.

See Also

mode, storage.mode.

Examples

typeof(2)
mode(2)

[Package base version 2.4.1 Index]