Describe the structure of an object

DESCRIPTION:

Describe the structure of an object, recursively.

USAGE:

showStructure(x, maxlen = 20, describeAttributes = TRUE,
   short = NULL, prefix = "", attri = FALSE, ...)

ARGUMENTS:

x
any object
maxlen
integer; if x is a list with more than maxlen components, only the names are printed. This may be a vector, in which case the Kth element is used at the Kth level of recursion.
describeAttributes
logical; if FALSE then only the names of attributes are printed; the structure of the attributes is not shown.
short
NULL or logical; this may be used by methods, to indicate whether to print a shorter description. It is currently used by bdFrame and bdVector methods.
prefix
for internal use in recursive calls. This is used for indenting in recursive calls.
attri
for internal use in recursive calls. This is TRUE if the curent object being described is a list of attributes.
...
Additional argument that may be passed to methods; not currently used.

DETAILS:

This supports recursive objects, using recursive calls. Each level of recursion is indented two additional spaces. List components are shown with $, slots with @, and attributes with &.

VALUE:

This prints a description; it doesn't return anything useful.

AUTHOR(S):

Tim Hesterberg

SEE ALSO:

, (in R).

EXAMPLES:

a <- c(m=1, n=2)
b <- diag(1:3)
cc <- cbind(a=1:5, b=2:6, c=letters[1:5])
d <- data.frame(cc)
attr(d, "dup.row.names") <- TRUE
e <- ts(1:10, frequency = 4, start = c(1959, 2))
f <- list(a,b=b)
if(is.R()){
  setClass("track", representation(x="numeric", y="numeric"))
  g <- new("track", x=1:5, y=1:5)
} else {
  g <- signalSeries(data.frame(x = 11:20, y = 21:30), 1:10,
                    units = c("mm", "cm"))
}

showStructure(a)
showStructure(b)
showStructure(cc)
showStructure(d)
showStructure(e)
showStructure(f)
showStructure(g)  # prints with @ rather than $
showStructure(list(a=a, b=b))
showStructure(list(cc=cc, d, list(a,e)))