| addItems {svMisc} | R Documentation |
The function takes the (named) items of one vector and place them in a second vector if these names do not exist yet there, or replace corresponding content otherwise.
addItems(x, y, use.names = TRUE, replace = TRUE) addActions(obj = ".svActions", text = NULL, code = NULL, state = NULL, options = NULL, replace = TRUE) addIcons(obj = ".svIcons", icons, replace = TRUE) addMethods(methods)
x |
the vector to add items to. |
y |
the vector of which we want to inject missing items in 'x'. |
use.names |
use names of items to determine which one is unique, otherwise, the selection is done on the items themselves. |
replace |
do we replace existing items in 'x'? |
obj |
the name of the object in |
text |
the text of actions to add (label on first line, tip on other lines). |
code |
the R code of actions to add. |
state |
the default (strating) state of an action, as a succession of
letters: \"c\" = checked, \"u\" = unchecked (default); \"d\" = disabled,
\"e\" = enabled (default); \"h\" = hidden, \"v\" = visible (default).
Default values are facultative. Ex: |
options |
a character vector with other options to pass to the graphical toolkit for this action. |
icons |
a named character vector matching names of actions/panels with the URL or file name of icon resources accessible by the GUI client. |
methods |
the methods to add to |
Philippe Grosjean <phgrosjean@sciviews.org>
## I have a vector v1 with this: v1 <- c(a = "some v1 text", b = "another v1 text") ## I want to add items whose name is missing in v1 from v2 v2 <- c(a = "v2 text", c = "the missign item") addItems(v1, v2, replace = FALSE) ## Not the same as addItems(v1, v2, replace = TRUE) ## This yield different result (names not used and lost!) addItems(v1, v2, use.names = FALSE) ## This is useful to add actions, icons, descriptions, shortcuts or methods ## TODO: examples and use for functions addActions(), addIcons() and ## addMethods()