View source: R/add_standard_attr.R
add_standard_attr | R Documentation |
This function adds informative attributes to an object, including the source of the script that produced the object, a title, description and details of any parameters (if requested) and the date/time of file creation. These attributes help to maintain the links between the scripts in which objects are produced and any saved objects.
add_standard_attr(
x,
title = deparse(substitute(x)),
description = NULL,
param = NULL
)
x |
An object. |
title |
A string providing an informative title for the object. |
description |
A string providing an informative description of the object. |
param |
An object (e.g., a string) containing further details about an object. |
This function requires rstudioapi.
The function returns the object, x
, as inputted with standard attributes.
Edward Lavender
## Not run:
x <- runif(10, 0, 1)
out <- add_standard_attr(x)
attributes(out)
out <- add_standard_attr(x, title = "A numeric vector")
attributes(out)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.