4_print_objects: Print Object Information

Description Usage Arguments Details Examples

Description

Functions for printing objects, compactly but informatively.

Usage

1
2
3
4
5
6
7
8
9
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#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)

intoo documentation built on March 13, 2020, 1:45 a.m.

Related to 4_print_objects in intoo...