[R-SIG-Mac] Importing Excel files

peter dalgaard pdalgd at gmail.com
Mon Jun 18 23:53:15 CEST 2012


On Jun 18, 2012, at 23:06 , Victoria Xiao wrote:

> Hi all,
> 
> I'm trying to figure out how to import Excel files into R. I'm running Mac
> 10.6, and so far I've tried the xlsx and gdata packages; both gave error
> messages.
> 
> For the xlsx package, here is what I got:
> 
>> library(xlsx)
>> project.source = "/Users/vicki/Desktop/R/test/kdReport.xls" #change the
> path and file name here
>> PIGF.elisa.dat = read.xlsx (file=project.source, 1, header=T)
> Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl,
> : java.lang.IllegalArgumentException: Your InputStream was neither an OLE2
> stream, nor an OOXML stream
> 
> For the gdata package, it said that gtools was required; when gtools
> package was attempted to load, this error message resulted:
> 
> Error in loadNamespace(i[[1L]], c(lib.loc, .libPaths())) :
> there is no package called Œgtools‚
> In addition: Warning message:
> package Œgdata‚ was built under R version 2.15.1
> Error: package/namespace load failed for Œgdata‚
> 
> Does anyone know how to resolve either of these error messages, or if there
> are better packages to interact with Excel files in R on a Mac? Thanks so
> much.
> 

gdata works ok for me. Did you actually install gtools?

The 2.15.1 issue is probably harmless. (We really shouldn't be building packages with an unreleased R version, though.) 

> Sincerely,
> Victoria Xiao
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-SIG-Mac mailing list