[Rprotobuf-commits] r346 - papers/user2010

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jul 22 19:25:44 CEST 2010


Author: edd
Date: 2010-07-22 19:25:44 +0200 (Thu, 22 Jul 2010)
New Revision: 346

Modified:
   papers/user2010/slides.Rnw
Log:
current snapshot of slides


Modified: papers/user2010/slides.Rnw
===================================================================
--- papers/user2010/slides.Rnw	2010-07-19 03:31:53 UTC (rev 345)
+++ papers/user2010/slides.Rnw	2010-07-22 17:25:44 UTC (rev 346)
@@ -45,7 +45,7 @@
 
 \begin{frame}
   \frametitle{Brief Description}
-  \framesubtitle{FIXME ?}
+  %\framesubtitle{FIXME ?}
 
   \begin{itemize}
     \item Google's Protocol Buffers are a flexible, efficient, automated mechanism for
@@ -173,7 +173,7 @@
 
 \begin{frame}
   \frametitle{Brief Description}
-  \framesubtitle{FIXME !!}
+  %\framesubtitle{FIXME !!}
 
   \begin{itemize}
   \item The \pkg{RProtoBuf} package implements \proglang{R} bindings to the
@@ -201,8 +201,77 @@
 %   report on this at the conference.
 % \end{frame}
 
-\subsection{Example}
+\subsection{Examples}
+
+\subsubsection{Adressbook}
 \begin{frame}
+  \frametitle{Addressbook example from R}
+  \framesubtitle{See \texttt{demo(addressbook)}}
+
+  \begin{small}
+<<eval=FALSE>>=
+# load the package
+require( RProtoBuf )
+
+# read the proto file
+readProtoFiles( files="addressbook.proto" )
+
+# create a prototype with a call to new
+# on the descriptor for the Person type,
+# then update the message # with fields
+romain <- update( new( tutorial.Person ),
+   email = "romain at r-enthusiasts.com",
+   id = 1, name = "Romain Francois",
+   phone = new(tutorial.Person.PhoneNumber,
+     number = "+33(0)...", type = "MOBILE"))
+# continued on next slide...
+#
+@
+\end{small}
+
+\end{frame}
+
+\begin{frame}
+  \frametitle{Addressbook example from R (cont)}
+
+  \begin{small}
+<<eval=FALSE>>=
+# directly supply parameters to the ctor
+dirk <- new( tutorial.Person,
+   email = "edd at debian.org",
+   id = 2, name = "Dirk Eddelbuettel" )
+
+# update the phone repeated field with list
+dirk$phone <- list(
+  new( tutorial.Person.PhoneNumber,
+       number = "+01...", type = "MOBILE" ),
+  new( tutorial.Person.PhoneNumber ,
+       number = "+01...", type = "HOME" ) )
+@
+\end{small}
+\end{frame}
+
+\begin{frame}
+  \frametitle{Addressbook example from R (cont)}
+
+  \begin{small}
+<<eval=FALSE>>=
+# build the address book
+book <- new( tutorial.AddressBook,
+             person = list( romain, dirk ) )
+
+# debug content -- this is not wire content
+writeLines( as.character( book ) )
+
+# the serialized message,
+# see also the io demo
+serialize( book, NULL )
+@
+\end{small}
+\end{frame}
+
+\subsubsection{(Stylized) High-Frequency Financial Data}
+\begin{frame}
   \frametitle{Example \texttt{proto} file for Financial Data}
 
   \begin{small}



More information about the Rprotobuf-commits mailing list