| gradio | R Documentation | 
A radio button group allows a user to select one from many
items. In gWidgets2 the radio button widget shows 2 or more
items. The items are coerced to characters, usually by the
underlying toolkit. Use the coerce_with property to set a
function, such as as.numeric, to coerce the return value
during the svalue code. The items are referred to with the
[ method, the selected one with svalue.
The svalue method returns the radio button label or its index if
index=TRUE. Labels are coerced to character by many of the
toolkits. To be sure to return a numeric value, one can assign to
the coerce_with property, e.g., obj$coerce_with <-
as.numeric. For all widgets, if a function is specified to
coerce_with  it will be called on the value returned by
svalue.
For a radio button group, for svalue the value can be
referred to by index or label.
Check for repeated items before passing on to set_items
gradio(
  items,
  selected = 1,
  horizontal = FALSE,
  handler = NULL,
  action = NULL,
  container = NULL,
  ...,
  toolkit = guiToolkit()
)
.gradio(
  toolkit,
  items,
  selected = 1,
  horizontal = FALSE,
  handler = NULL,
  action = NULL,
  container = NULL,
  ...
)
## S3 method for class 'GRadio'
svalue(obj, index = NULL, drop = TRUE, ...)
## S3 replacement method for class 'GRadio'
 svalue(obj,index=NULL,drop=TRUE,...) <- value
## S3 replacement method for class 'GRadio'
 x[i, j, ...] <- value
| items | items to select from | 
| selected | index of initially selected item | 
| horizontal | layout direction | 
| handler | A handler assigned to the default change
signal. Handlers are called when some event triggers a widget to
emit a signal. For each widget some default signal is assumed, and
handlers may be assigned to that through  Handlers may also be added via  | 
| action | User supplied data passed to the handler when it is called | 
| container | A parent container. When a widget is created it can be incorporated into the widget heirarchy by passing in a parent container at construction time. (For some toolkits this is not optional, e.g. gWidgets2tcltk or gWidgets2WWW2.) | 
| ... | These values are passed to the  | 
| toolkit | Each widget constructor is passed in the toolkit it
will use. This is typically done using the default, which will
lookup the toolkit through  | 
| obj | object of method call | 
| index | NULL or logical. If  | 
| drop | NULL or logical. If widget supports it, drop will work as it does in a data frame or perhaps someother means. | 
| value | items to assigns a choices for the buttons | 
| x | 
 | 
| i | button index. Leavel as missing to replace items to select from. | 
| j | ignored | 
if(interactive()) {
  w <- gwindow("Selection widgets")
  g <- gvbox(cont=w)
  fl <- gformlayout(cont=g)
  gcheckbox("checkbox", checked=TRUE, cont=fl, label="checkbox")
  gradio(state.name[1:4], selected=2, horizontal=TRUE, cont=fl, label="gradio")
  gcheckboxgroup(state.name[1:4], horizontal=FALSE, cont=fl, label="checkbox group")
  bg <- ggroup(cont=g)
  gbutton("ok", cont=bg, handler=function(h,...) print(sapply(fl$children, svalue)))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.