OpsExtract | R Documentation |
Extract parts of a Container
object similar
to R's base extract operators on lists.
## S3 method for class 'Container' x[...] ## S3 method for class 'Container' x[[i]]
x |
|
i, ... |
indices specifying elements to extract. Indices
are |
[
selects multiple values. The indices can be numeric
or
character
or both. They can be passed as a vector
or list
or,
for convenience, just as a comma-separated sequence (see Examples).
Non-existing indices are ignored.
[[
selects a single value using a numeric
or character
index.
co = container(a = 1, b = 2, c = 3, d = 4) co[1:2] co[1, 4] co["d", 2] co[list("d", 2)] co[0:10] co = container(a = 1, b = 2) co[[1]] co[["a"]] co[["x"]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.