Description Usage Arguments Value Examples
View source: R/as_data_frame_enumeration.R
The data.frame is useful for debugging purposes, filling list and combo boxes in user interfaces to select one value etc.
1 2 3 | ## S3 method for class 'enumeration'
as.data.frame(x, row.names = NULL,
optional = FALSE, ...)
|
x |
An object of class "enumeration" (created with |
row.names |
|
optional |
Currently not used (but required for a compatible S3 interface) |
... |
Currently not used (but required for a compatible S3 interface) |
A data.frame with three columns: allowed.values, value.names and descriptions.
The 'descriptions' column is set to the names attribute of the enum if no 'descriptions'
attribute exists. Character strings are never converted to factors (stringsAsFactors = FALSE
).
1 2 3 | DRINKS <- create.enum(c(COFFEE = 1, TEA = 2, SOFT_DRINK = 3),
descriptions = c("hot", "hotter", "cold"))
as.data.frame(DRINKS)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.