Description Super class Active bindings Methods
Key-value dictionary type base class contains a machine learning project option. A majority of features are derived from Dict::Dict class.
Some concreate classes that stores a project option are also defined in this package, so you do not need to play with this class directly.
Dict::Dict -> Option
value_widthmax print width.
new()Construct a new Option class object.
Option$new( ..., .class = "any", .key_prefix = "opt", .key_width = 2L, .value_width = Inf )
...Key and value pairs.
.classA character scalar of object's class. Should be one of the
outputs from class().
.key_prefixA character scalar of key prefix. Used for an auto complement key's prefix, if the key is omitted.
.key_widthA integer scalar of auto increment key number width.
If .key_width = 2L (default) and .key_prefix = "op" (default), the
first auto complement key will be op01.
.value_widthA integer scalar of character length. Used as max
width of output value by self$print() method.
A new Option class object.
print_items()Print option items.
Option$print_items(items_name = "Objects", format_fun = NULL)
items_nameA character scalar of printed item name.
format_funA funtion to format item values. Must be a function that receives a option's value and returns a character scalar.
add()Adds key-value objects to the dictionary.
Option$add(...)
...Key and value pairs.
remove()Removes objects from the dictionary.
Option$remove(key = NULL)
keyA character scalar.
clear()Overwrite super class's self$clear() to throw an error which ensures
the Option object always has at least one item.
Option$clear()
clone()The objects of this class are cloneable with this method.
Option$clone(deep = FALSE)
deepWhether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.