contents {refset} | R Documentation |
Returns or changes parcel contents
Description
contents
returns the value of the parcel contents by evaluating
the expression in the parcel. contents<-
attempts to assign
to the expression, which will only work if the expression is appropriate, e.g.
a refset.
Usage
contents(parcel)
contents(parcel) <- value
Arguments
parcel |
an object of class 'parcel' |
value |
a value to assign |
Value
The result of evaluating the expression stored in the parcel.
For contents<-
, the parcel itself.
contents<-
will only work if the expression wrapped in the
parcel can accept assignments.
See Also
Other wrapping functions: is.parcel
,
unwrap_as
, wrapset
,
wrap
Examples
pcl <- wrap(x^2)
x <- 2
contents(pcl)
x <- 3
contents(pcl)
## Not run:
contents(pcl) <- 4 # fails
## End(Not run)
p2 <- wrap(names(x))
contents(p2) <- "named"
x
[Package refset version 0.1.1 Index]