is.shared | R Documentation |
Test whether an object is shared
is.shared(x, ..., depth = 0, showAttributes = FALSE)
## S4 method for signature 'ANY'
is.shared(x, ..., depth = 0, showAttributes = FALSE)
x |
An R object |
... |
For generalization purpose only |
depth |
Whether to recursively check the element of |
showAttributes |
Whether to check the attributes of |
When depth=0
, the is.shared
function return a single logical value indicating
whether x
is shared or contains any shared objects. When depth>0
and x
is a
container(e.g. list
), the function will recursively check each element of x
and
return a list with each elements corresponding to the elements in x
.
The depth
parameter determines the depth of the checking procedure.
if showAttributes = TRUE
, the attributes of the object will also be checked. The
check result is returned as attributes of the return value by appending Shared
to the
end of the original attribute names. Note that showAttributes
has
no effect on an S4 object for the attributes of an S4 object are used to store the
slots and should not be treated as the attributes of an object.
a single logical value or a list.
x1 <- share(1:10)
is.shared(x1)
x2 <- share(list(a=1:10, b = list(d = letters, e = runif(10))))
is.shared(x2, depth=0)
is.shared(x2, depth=0, showAttributes = TRUE)
is.shared(x2, depth=1)
is.shared(x2, depth=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.