2

I have been mainly working with .xlsb files(binary file type of xlsx) which I would like to read/write using R. Could you please let me know if there is any package that is available for this or do I need to create package on my own? RODBC did not work too.

vaibhav
  • 87
  • 2
  • 6

1 Answers1

1

Try the excel.link package. The xl.read.file function allows rectangular data sets to be read-in, though there are other options available.

You also need to (install and) call the RDCOMClient package before running the first excel.link function.

e.g.,

read_xlsb <- function(x){
  require("RDCOMClient")
  message(paste0("Reading ", x, "...\n"))
  df <- excel.link::xl.read.file(filename = x, header = TRUE, 
                                 xl.sheet = Worksheet_name)
  df$filename <- x
  df <- as.data.frame(df) 
  return(df)  
}

The only annoynce I've found is that I can't override Excel's "save on close" functionality so these pop-ups need to be closed by hand.

BTW I think excel.link only works on Windows machines.