Learn R Programming

traitr (version 0.14)

numericItem: Item for numbers

Description

Item for numbers

Usage

numericItem(value = numeric(0), name, label = name, help = "", tooltip = "", eval_first = FALSE, attr, model, editor, ...)

Arguments

value
Default value for the model
name
Required name for object. Names should be unique within a group of items
label
Optional label, default value is the name
help
Optional help string
tooltip
Optional tooltip to display
eval_first
Should value be run through eval/parse before coercion.
attr
A list of attributes to pass to widget on construction. Eg. attr=list(size=c(100,200))
model
Optional model. Useful if one wishes to use same model for multiple views
editor
Specification of editor (a view) to override default
...
Passed to parent proto object during call to proto

Value

A proto object. Call obj$show_help() to view its methods and properties.

See Also

Item

Examples

Run this code
## basic use
a <- numericItem(0, name="x")
a$set_x(10)
a$get_x()
## eval can be instructed
a <- numericItem(0, name="x", eval_first=TRUE)
a$set_x("1:5")
a$get_x()
a$to_R()

Run the code above in your browser using DataLab