| NamedList | R Documentation |
A class for lists with key-value pairs - aka in R: named lists
staypuft::FieldABC -> staypuft::Field -> NamedList
new()NamedList$new(keys, values, ...)
serialize_()NamedList$serialize_(value, attr = NULL, obj = NULL)
deserialize_()NamedList$deserialize_(value, attr = NULL, data = NULL)
clone()The objects of this class are cloneable with this method.
NamedList$clone(deep = FALSE)
deepWhether to make a deep clone.
x <- Schema$new("foo",
title = fields$character(),
age = fields$integer(strict = TRUE),
name = fields$named_list(keys=fields$character(), values=fields$number())
)
x
# good
x$load(list(
title = "barry",
age = 3L,
name = list(foo = 3.4, iff = 5)))
# bad
if (interactive()) {
x$load(list(
title = "barry",
age = 3L,
name = list(foo = 3.4, iff = "a")))
x$load(list(
title = "barry",
age = 3L,
name = list("bar", "else")))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.