5

I am trying to read a range into a data frame from a xlsb workbook. Can I do this with the xlsx package in R? If not, does anyone know of a way to do it?

Scarabee
  • 5,437
  • 5
  • 29
  • 55
Satya
  • 51
  • 1
  • 1
  • 3

2 Answers2

10

Have a look at the excel.linkpackage here. It allows you to write / read data easily like so :

df<-xl[a1:b2] # if the file is open

or

df<-xl.read.file('filename.xlsb',header=TRUE, top.left.cell="A1") # if the file isn't open
Scarabee
  • 5,437
  • 5
  • 29
  • 55
etienne
  • 3,648
  • 4
  • 23
  • 37
0

Based on reading the xlsx package guide, I would think the package isn't compatible for xlsb formats. xlsb stores in binary format, whereas other excel formats are in XML. xls is an Excel 95 binary format, but apparently xlsb isn't compatible with Excel versions 2003 and prior.

Your best bet might be to try RODBC, or to save your workbook as a .csv and import from there.

JFu
  • 121
  • 1
  • 6