Description Usage Arguments Details Author(s) See Also Examples
Function to create a registry object.
1 2 |
entry_class |
character string indicating a class the returned registry object will additionally inherit from (optional). Used for dispatching user-specified print and summary methods. |
registry_class |
character string indicating a class the registry entries will additionally inherit from (optional). Used for dispatching user-specified print and summary methods. |
validity_FUN |
a function accepting a new registry entry as argument for checking its validity and possibly aborting with an error message. The entry will be provided by the calling function as a list with named components (fields). |
stop_if_missing |
logical indicating whether the registry lookup
functions should abort or just return |
This is a generating function that will return a registry object whose
components are accessor functions for the contained data. These are
documented separately (regobj
).
David Meyer David.Meyer@R-project.org
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | R <- registry()
R$set_field("X", type = TRUE)
R$set_field("Y", type = "character")
R$set_field("index", type = "character", is_key = TRUE,
index_FUN = match_partial_ignorecase)
R$set_field("index2", type = "integer", is_key = TRUE)
R$set_entry(X = TRUE, Y = "bla", index = "test", index2 = 1L)
R$set_entry(X = FALSE, Y = "foo", index = c("test", "bar"), index2 = 2L)
R$get_entries("test")
R[["test", 1]]
R["test"]
R[["test"]]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.