Learn R Programming

intoo (version 0.4.0)

4_print_objects: Print Object Information

Description

Functions for printing objects, compactly but informatively.

Usage

object.model (object, …,
    value=FALSE,
    private.attributes=TRUE, public.attributes=TRUE,
    attribute.values=value, comment=FALSE, n=3)

object.summary (object,…, value=TRUE, private.attributes=FALSE, public.attributes=TRUE, attribute.values=value, comment=TRUE, n=6)

Arguments

object

An object.

value

If true, print the object's value.

private.attributes

If true, print private attributes, regarded as attributes starting with a period.

public.attributes

If true, print public attributes, regarded as attributes not starting with a period.

attribute.values

If true, print the attributes' values.

comment

If true, print the object's comment attribute, if applicable.

n

Number of elements, lines or rows to print.

Ignored.

Details

These functions are the same, except for their defaults.

By default, the object.model function prints a compact representation of an object. And by default, the object.summary function prints a semi-compact representation of an object.

Output contains non-recursive information regarding attributes. In general, language-related attributes (such as names) are excluded from the list of attributes.

The object.summary function has output intermediate between the str and head functions, and is particularly suitable for printing functions bundled with data.

Examples

Run this code
# NOT RUN {
#function object
#with private and public attributes
f <- function (x)
{   . = THAT ()
    with (.,
        paste (A, B, x, sep=":") )
}
f <- EXTEND (f, "concat", .X=10, A="A", B="B")

#compact print
object.model (f)

#semi-compact print
object.summary (f)
# }

Run the code above in your browser using DataLab