[R] Modifying output to Google Docs
Duncan Temple Lang
duncan at wald.ucdavis.edu
Wed Sep 24 19:59:05 CEST 2008
The command line app is fine, although there are some potential security
issues or annoyances with a smooth work flow.
But it would be more flexible and powerful to do it directly in R.
And we don't need to know or program in C. The RCurl (https, getForm()
and postForm()) and XML packages provide all we need.
It took a couple of hours of reading the Google documentation,
designing and writing the R code and _testing_, but in relatively
few lines of code, the RGoogleDocs "package" enables an R user
to query, delete, download and upload documents to her Google account.
This was one of the motivations for developing the XML and RCurl
packages, i.e. to be able to quickly develop utilities in R to
communicate with Web "apps". So Ajay's suggestion was a nice
exercise to see if the packages do make it easy.
The package currently has no Rd files, but there is a brief "user's
guide". The package is available from
For binary files, you will want to grab a beta-version of RCurl
Barry Rowlingson wrote:
> 2008/9/23 Ajay ohri <ohri2007 at gmail.com>:
>> By outputting PDF directly to a Google Doc, it becomes light and portable
>> for people to view and collaborate on projects in different parts of the
>> If you extend this to Google spreadsheets this functionality is especially
>> useful for financial reporting or marketing metrics reports or collaborative
>> presentations to be made.
> There's command-line tools (written in python, but probably in other
> languages elsewhere) to do this:
> their example is:
> ./gdoc-cp.py --username someone at gmail.com --import --local
> files/doc.txt --title "New Document"
> So all you need to do is call that from R with system() and wrap it
> up in some R functions.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help