# example proto file supplied with this package
proto.file <- system.file( "proto", "addressbook.proto", package = "RProtoBuf" )
# reading a proto file and creating the descriptor
Person <- P( "tutorial.Person", file = proto.file )
Person <- P("tutorial.Person")
# enum type
Person$PhoneType
has(Person$PhoneType, "MOBILE")
has(Person$PhoneType, "HOME")
has(Person$PhoneType, "WORK")
has(Person$PhoneType, "FOOBAR")
length(Person$PhoneType)Run the code above in your browser using DataLab