description: Data Description

View source: R/description.R

descriptionR Documentation

Data Description

Description

Assign or retrieve a text description to an object.

Usage

description(x, ...)

Arguments

x

Target object.

...

Other arguments (not used).

y

Character string(s) specifying the name(s) of the variables or attributes to be assigned a description string.

value

Character string(s) specifying the text description to be assigned.

Details

The description attribute may be erased by assigning a NULL value to it.

Value

An object with a description attribute attached to it.

Functions

description

Generic description retrieval method.

description.default

Default description retrieval method.

description<-

Generic description assignment method.

description<-.default

Default description assignment method.

See Also

metadata

Examples

x <- data.frame(year = 2010:2014, measurement = rnorm(5))
description(x) <- "A simple table"
description(x, "year") <- "Year the sample was taken."
description(x, "measurement") <- "Length of the specimen."

# ... or equivalently:
description(x, c("year", "measurement")) <- c("Year the sample was taken.",
  "Length of the specimen.")
description(x) <- c(year = "Year the sample was taken.",
  measurement = "Length of the specimen.")
description(x) <- list(year = "Year the sample was taken.",
  measurement = "Length of the specimen.")

# Show attributes:
attributes(x)

# Erase 'description' attribute:
description(x, "year") <- NULL  # Remove 'year' description.
description(x) <- NULL          # Remove all descriptions.


TobieSurette/gulf.metadata documentation built on Dec. 31, 2022, 5:35 a.m.