Learn R Programming

traitr (version 0.14)

stringItem: A string item

Description

A string item

Usage

stringItem(value = "", regex = NULL, name, label = name, help = "", tooltip = "", eval_first = FALSE, attr, model, editor, ...)

Arguments

value
Default value for the model
regex
If non NULL specifies a regular expression for validation.
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 usage
a <- stringItem("ac", name="x")
a$get_x()
a$set_x("abc213")
a$get_x()
## eval first
a <- stringItem("ac", name="x", eval_first=TRUE)
a$set_x("2 + 2")
a$get_x()
a$to_R()

Run the code above in your browser using DataLab