comment: Query or Set a '"comment"' Attribute

Description Usage Arguments See Also Examples

Description

These functions set and query a comment attribute for any R objects. This is typically useful for data.frames or model fits.

Contrary to other attributes, the comment is not printed (by print or print.default).

Assigning NULL or a zero-length character vector removes the comment.

Usage

1
2
comment(x)
comment(x) <- value

Arguments

x

any R object

value

a character vector, or NULL.

See Also

attributes and attr for other attributes.

Examples

1
2
3
4
5
x <- matrix(1:12, 3, 4)
comment(x) <- c("This is my very important data from experiment #0234",
                "Jun 5, 1998")
x
comment(x)

Example output

     [,1] [,2] [,3] [,4]
[1,]    1    4    7   10
[2,]    2    5    8   11
[3,]    3    6    9   12
[1] "This is my very important data from experiment #0234"
[2] "Jun 5, 1998"