description | R Documentation |
Assign or retrieve a text description to an object.
description(x, ...)
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. |
The description
attribute may be erased by assigning a NULL
value to it.
An object with a description
attribute attached to it.
description
Generic description
retrieval method.
description.default
Default description
retrieval method.
description<-
Generic description
assignment method.
description<-.default
Default description
assignment method.
metadata
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.