fmt | R Documentation |
Functions to assigns or retrieve data formatting information to and from an object.
fmt(x, ...)
x |
Target object. |
... |
Other arguments (not used). |
y |
Character string(s) specifying the name(s) of the variables or attributes to be assigned data formats. |
value |
Character string(s) specifying the data format to be assigned. |
Named argiments in the format that are not in the target object are ignored.
The fmt
attribute may be erased by assigning a NULL
or empty
string ""
value to it.
Object with a format fmt
attribute attached to it.
fmt
Generic fmt
method.
fmt.default
Default fmt
method.
fmt<-
Generic format assignment method.
fmt<-.default
Default format assignment method. See Examples for usage.
metadata
x <- data.frame(year = 2010:2014, month = 6, day = 1:5, measurement = rnorm(5)) fmt(x, "year") <- "YYYY" fmt(x, "month") <- "MM" fmt(x, "day") <- "DD" # Equivalently: fmt(x) <- c(year = "YYYY", month = "MM", day = "DD") fmt(x, c("year", "month", "day")) <- c("YYYY", "MM", "DD") # Show attributes: attributes(x) fmt(x) # Erase 'fmt' attribute: fmt(x) <- NULL
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.