rk.XML.varslot: Create a XML node "varslot" for RKWard plugins

View source: R/rk.XML.varslot.R

rk.XML.varslotR Documentation

Create a XML node "varslot" for RKWard plugins

Description

Create a XML node "varslot" for RKWard plugins

Usage

rk.XML.varslot(
  label,
  source,
  property = NULL,
  required = FALSE,
  multi = FALSE,
  duplicates = FALSE,
  min = 1,
  any = 1,
  max = 0,
  dim = 0,
  min.len = 0,
  max.len = NULL,
  classes = NULL,
  types = NULL,
  id.name = "auto",
  help = NULL,
  component = rk.get.comp(),
  i18n = NULL
)

Arguments

label

Character string, a text label for the varslot.

source

Either a character string (the id name of the varselector to select variables from), or an object of class XiMpLe.node (whose id will be extracted and used). If it is not a <valueselector> node, you must also specify a valid property for the node.

property

Character string, valid property for a XiMpLe node defined by source. In the XML code, it will cause the use of source_property instead of source. Only used if source ist not a <valueselector> node.

required

Logical, whether the selection of variables is mandatory or not.

multi

Logical, whether the varslot holds only one or several objects.

duplicates

Logical, if multi=TRUE defines whether the same entry may be added multiple times. Sets multi=TRUE.

min

If multi=TRUE defines how many objects must be selected. Sets multi=TRUE.

any

If multi=TRUE defines how many objects must be selected at least if any are selected at all. Sets multi=TRUE.

max

If multi=TRUE defines how many objects can be selected in total (0 means any number). Sets multi=TRUE.

dim

The number of dimensions, an object needs to have. If dim=0 any number of dimensions is acceptable.

min.len

The minimum length, an object needs to have.

max.len

The maximum length, an object needs to have. If NULL, defaults to the largest integer number representable on the system.

classes

An optional character vector, defining class names to which the selection must be limited.

types

If you specify one or more variables types here, the varslot will only accept objects of those types. Valid types are "unknown", "number", "string", "factor", "invalid". Optional, use with great care, the user should not be prevented from making valid choices, and rkward does not always know the type of a variable!

id.name

Character vector, unique ID for the varslot. If "auto", the ID will be generated automatically from label.

help

Character string or list of character values and XiMpLe nodes, will be used as the text value for a setting node in the .rkh file. If set to FALSE, rk.rkh.scan will ignore this node. Also needs component to be set accordingly!

component

Character string, name of the component this node belongs to. Only needed if you want to use the scan features for automatic help file generation; needs help to be set accordingly, too!

i18n

Either a character string or a named list with the optional elements context or comment, to give some i18n_context information for this node. If set to FALSE, the attribute label will be renamed into noi18n_label.

Value

An object of class XiMpLe.node.

See Also

rk.XML.vars, rk.XML.varselector, and the Introduction to Writing Plugins for RKWard

Examples

## Not run: 
test.varselector <- rk.XML.varselector("Select some vars")
test.varslot <- rk.XML.varslot("Vars go here", source=test.varselector)
cat(pasteXML(test.varslot))

## End(Not run)

rkward-community/rkwarddev documentation built on May 9, 2022, 3:02 p.m.