Last chance! 50% off unlimited learning
Sale ends in
Convenience wrapper that allow getting and setting fields of protocol buffer messages from within the object
# S3 method for Message
with(data, expr, ...)
# S3 method for Message
within(data, expr, ...)
R expression to evaluate
ignored
with
returns the value of the expression and
within
returns the data
argument.
The expression is evaluated in an environment that allows to set and get fields of the message
The fields of the message are mapped to active bindings (see makeActiveBinding) so that they can be accessed and modified from within the environment.
# NOT RUN {
proto.file <- system.file( "proto", "addressbook.proto", package = "RProtoBuf" )
Person <- P( "tutorial.Person", file = proto.file )
# }
# NOT RUN {
romain <- within( new( Person ), {
email <- "francoisromain@free.fr"
id <- 10L
} )
# }
Run the code above in your browser using DataLab