unitest.proto.file <- system.file("tinytest", "data", "unittest.proto",
package = "RProtoBuf" )
readProtoFiles(file = unitest.proto.file)
test <- new(protobuf_unittest.TestAllTypes)
test$size("optional_int32")
test$add("repeated_int32", 1:10)
test$size("repeated_int32")
test$repeated_int32
size(test, "repeated_int32") <- 5
test$repeated_int32
size(test, "repeated_int32") <- 15
test$repeated_int32
Run the code above in your browser using DataLab