Learn R Programming

RProtoBuf (version 0.1-0)

listPeople: List content of address book example for ProtoBuf

Description

These function provide two simple examples for using ProtoBuf generated accessor functions to import ProtoBuf data into R.

Usage

listPeopleAsList(filename, verbose=FALSE)
  listPeopleAsDataFrame(filename, verbose=FALSE)

Arguments

filename
complete path to a binary addressbook written in function built from the addressbook.proto description; an example file is used is no argument is supplied
verbose
optional boolean flag indicating verbose operation

Value

  • For listPeopelAsDataFrame, a data.frame combining the id,name,email and id,phoneType,phoneNumber data sets. For listPeopelAsList, a nested list combining the id, name, email and phoneType, phoneNumber data sets.

Details

This function provides an implementation of the list_people.cc example provided with the ProtoBuf compiler.

Protocol Buffers is a serialization format with an interface description language developed by Google. The original Google implementation for C++, Java and Python is available under the BSD license at http://code.google.com/p/protobuf/. A good description of Protocol Buffers is available at http://en.wikipedia.org/wiki/Protocol_Buffers.

This function is a first attempt of importing binary data from ProtoBuf files into R.

Examples

Run this code
print(listPeopleAsList())
  print(listPeopleAsDataFrame())

Run the code above in your browser using DataLab