How to read Excel files into R with package ‘XLConnect’

How to read data from Excel into R: http://www.dummies.com/how-to/content/how-to-read-data-from-excel-into-r.html

  1. Make sure ‘Java Development Kit’ is installed on the computer
  2. To add Java support to R run this command as root:
    #!/bin/bash
    R CMD javareconf
    
  3. Install and load the package in R
    install.packages('XLConnect')
    library('XLConnect')
    
  4. Read Excel file
    fxls=readWorksheetFromFile('file.xls', sheet=1)
    

 

Error message:
“OldExcelFormatException (Java): The supplied spreadsheet seems to be Excel 5.0/7.0 (BIFF5) format. POI only supports BIFF8 format (from Excel versions 97/2000/XP/2003)”

!!  Only supports format from Excel versions 97/2000/XP/2003 !!
See gdata for newer Excel files!

 

Leave a Comment