Learn R Programming

RProtoBuf (version 0.4.22)

type-methods: Gets the type or the C++ type of a field

Description

Gets the type or the C++ type of a field

Arguments

object

A FieldDescriptor object.

as.string

If true, print a string representation of the type.

See Also

The method is implemented for the FieldDescriptor class

Examples

Run this code
if (FALSE) {
proto.file <- system.file( "proto", "addressbook.proto", package = "RProtoBuf" )
Person <- P( "tutorial.Person", file = proto.file )
}
Person <- P( "tutorial.Person" )
type(Person$id)
type(Person$id, as.string=TRUE)
cpp_type(Person$email)
cpp_type(Person$email, TRUE)

Run the code above in your browser using DataLab