Description Usage Arguments Value Author(s) See Also Examples
There is a builtin ENUM data set storing enumerations that are quite handy when applying mso-family functions.
1 |
enum_name |
vector, can be
|
... |
When |
family |
character vector of the enumeration families, e.g., "MsoFileType".
You can use |
unlist |
logical, whether unlist the result. Default TRUE. |
bare |
logical, whether only return bare enumeration numbers. Default FALSE. |
unlist
= TRUEreturn a vector, with a vector of 'family' attribute on the vector (of same length as the result)
unlist
= FALSEreturn a list, with a 'family' attribute on each element
enum_name
is NULL or NAreturn all the enumerations that match
return NA
Yiying Wang, wangy@aetna.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | ## Not run:
enum(msoChart) # equivalent to enum("msoChart")
# msoChart
# 3
# attr(,"family")
# [1] "msoShapeType"
enum(msoChart, unlist=FALSE) # or enum("msoChart", unlist=FALSE)
# $`msoChart`
# [1] 3
# attr(,"family")
# [1] "msoShapeType"
enum(msoChart, msoTable) # or enum(c(msoChart, msoTable))
# or enum(msoChart, family="Mso")
# msoChart msoTable
# 3 19
# attr(,"family")
# [1] "msoShapeType" "msoShapeType"
enum(msoChart, family=c("Xl", "Wd")) # "msoChart" not in these families
# [1] NA
enum(NULL, family="XlAxisGroup") # return all the enums of "XlAxisGroup"
# xlPrimary xlSecondary
# 1 2
# attr(,"family")
# [1] "XlAxisGroup" "XlAxisGroup"
enum(msoChart, bare=TRUE) # only return bare number
# [1] 3
# feel free to use purrr::as_mapper
getEnum <- function(family, enum_name) {
purrr:::as_mapper(c(family, enum_name))
}
getEnum("MsoShapeType", "msoChart")
# [1] 3
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.