Description Usage Arguments Details Examples
Bendict class is a convenience wrapper around named list to allow custom printer.
1 2 3 4 5 6 7 | bendict(...)
is.bendict(obj)
is.dictlike(obj)
as.bendict(obj)
|
... |
Key value pairs |
obj |
An R object |
bendict
: Constructor similar to list(...)
.
is.bendict
: TRUE if the object is a bendict
.
is.dictlike
: TRUE if object is a bendict
or can be treated
as such. An object is dictlike
if it's a vector or list and all its
names have positive length.
as.bendict
: Convert to bendict
object.
1 2 3 4 5 6 7 8 9 10 | (x <- bendict(op = "eval", code = "log(5)"))
is.bendict(x)
as.bendict(list(A = 5, B = "C"))
as.bendict(c(A = 5, B = "C")) # same
is.dictlike(c(1, 2)) # FALSE
is.dictlike(c(A = 1, B = 2)) # TRUE
is.dictlike(c(1, B = 2)) # TRUE (not all are named)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.