[R] Read a Google Spreadsheet?

Spencer Graves spencer.graves at structuremonitoring.com
Thu Sep 5 00:12:32 CEST 2013


Hello, All:


What do you recommend for reading a Google Spreadsheet into R? I didn't 
find anything useful using library(sos); findFn('google spreadsheet').


I can solve the problem by downloading the file either as *.ods or 
*.xlsx format, then opening it and saving it as *.xls, then using 
read.xls{gdata}.


Alternatives I haven't tried use read.xlsx{xlsx} and 
readWorksheetFromFile{XLConnect} with 32-bit R. Neither of these work 
for me with 64-bit R, because they can't find an appropriate rJava on my 
computer; see below. (I've been using 64-bit R with Emacs, so switching 
to 32-bit R is not completely trivial.) Similarly, 
read.gnumeric.sheet{gnumeric} requires the "external program, 
ssconvert", which seems not to be available on my computer or installed 
for 64-bit R.


What do you suggest? Avoid 64-bit R unless I really need it? That seems 
to be the message I'm getting from this. (The writeFindFn2xls{sos} also 
works in 32-bit R but fails in 64-bit apparently for the same reason.)


Thanks,
Spencer


 > library(xlsx)
Loading required package: xlsxjars
Loading required package: rJava
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: No CurrentVersion entry in Software/JavaSoft registry! Try 
re-installing Java and make sure R and Java have matching architectures.
Error: package ‘rJava’ could not be loaded
 > library(XLConnect)
Loading required package: rJava
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: No CurrentVersion entry in Software/JavaSoft registry! Try 
re-installing Java and make sure R and Java have matching architectures.
Error: package ‘rJava’ could not be loaded
 > sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base


-- 
Spencer Graves, PE, PhD
President and Chief Technology Officer
Structure Inspection and Monitoring, Inc.
751 Emerson Ct.
San José, CA 95126
ph:  408-655-4567
web:  www.structuremonitoring.com



More information about the R-help mailing list