Last data update: 2014.03.03

R: Obtain most common information on data structures.
what.isR Documentation

Obtain most common information on data structures.

Description

Takes any object as argument and returns (1) a dataframe with the class(es), type, mode and storage mode of the object as well as the dim, length and object.size; (2) a character vector of all the identifier functions (starting with "is.") that yield TRUE with the provided object; (3) a named character vector giving all attributes (for instance, "names", "row.names", "class", "dim", and so on) along with their lengths.

Usage

  what.is(x, show.all = FALSE, ignore.size.warn = FALSE)

Arguments

x

Any object.

show.all

When TRUE, all logical results from the “is.” identifier functions will be displayed, accompanied by a warning when only the result applies only to the first element in the structure. FALSE by default.

ignore.size.warn

Set to TRUE to force execution of the function for large (>20 K bytes) objects. Defaults to FALSE.

Details

The function is an attempt to centralize the most common “macro-level” functions that describe the data at hand. Instead of calling, in turn, class, typeof, dim, and so on, a single call to what.is will readily give all that information.

Value

A list with 3 named items: “obj.properties” containing class, typeof, mode, storage.mode, dim and length; “identifiers” containing the “is.” identifier functions that yield TRUE; “attributes” containing the names and lengths of attributes; optionally, a 4th item with all the identifier test results (when argument show.all=TRUE)

Author(s)

Dominic Comtois <dominic.comtois@gmail.com>

Examples

  what.is(1)
  what.is(NaN)
  what.is(iris3)

Results