Questions tagged [xlconnect]

XLConnect is a comprehensive and platform-independent R package for manipulating Microsoft Excel files from within R. XLConnect differs from other related R packages in that it is completely cross-platform and as such runs under Windows, Unix/Linux and Mac (32- and 64-bit). Moreover, it does not require any installation of Microsoft Excel or any other special drivers to be able to read & write Excel files.

XLConnect: Excel Connector for R

XLConnect is a comprehensive and cross-platform R package for manipulating Microsoft Excel files from within R. XLConnect differs from other related R packages in that it is completely cross-platform and as such runs under Windows, Unix/Linux and Mac (32- and 64-bit). Moreover, it does not require any installation of Microsoft Excel or any other special drivers to be able to read and write Excel files. The only requirement is a recent version of a Java Runtime Environment (JRE).

The package can easily be installed from CRAN via install.packages("XLConnect") (or install.packages("XLConnect", type="source") on Mac OS X).

Alternatively, the package can be installed directly from github using the devtools package:

require(devtools)
# Installs the master branch of XLConnect (current development version)
install_github("xlconnect", username = "miraisolutions", ref = "master")

Resources:

226 questions
111
votes
12 answers

Read all worksheets in an Excel workbook into an R list with data.frames

I understand that XLConnect can be used to read an Excel worksheet into R. For example, this would read the first worksheet in a workbook called test.xls into R. library(XLConnect) readWorksheetFromFile('test.xls', sheet = 1) I have an Excel…
Jeromy Anglim
  • 33,939
  • 30
  • 115
  • 173
38
votes
4 answers

How to extract sheet names from Excel file in R

I have loaded a workbook into R and read in the worksheets using xlConnect, but I was wondering if there was a way of extracting the names of the sheets perhaps in a vector? So far my code is: dataIn<-loadWorkbook(file.path(filenames[1],sep="")) lst…
userk
  • 901
  • 5
  • 11
  • 19
21
votes
1 answer

How to fix OutOfMemoryError (Java): GC overhead limit exceeded in r?

I have to read a file in a list of folders and save data in R. I use following code for my test data and it works. When I use the code for the actual data then I get this error Error: OutOfMemoryError (Java): GC overhead limit exceeded Called from:…
poshan
  • 3,069
  • 5
  • 20
  • 30
18
votes
2 answers

Using R to read out excel-colorinfo

Is there any way to read out the color-index of cells from excel files with R? While I can set the cell color with packages like XLConnect or XLSX, I have found no way to extract the color-information from existing workbooks.
Bens
  • 183
  • 1
  • 4
15
votes
1 answer

Downloading Excel File from XLConnect with R Shiny

Has anyone tried using the download handler in R Shiny to download a freshly created Excel file with XLConnect? In the ui.R there is the unremarkable line: downloadButton('downloadData', 'Download') In the server.R there is the…
steinbock
  • 726
  • 1
  • 12
  • 25
13
votes
2 answers

Extract the number of sheets from an Excel workbook in R (without XLConnect)

I'm relatively new to R (and programming). I have an Excel workbook with 36 sheets, but suppose that I don't know how many sheets there are and I want my code to find that out for me. I have tried something like: options(java.parameters =…
Kaveh Dianati
  • 145
  • 1
  • 1
  • 6
12
votes
4 answers

Error in XLConnect

I am trying to import an excel sheet into r. I used the following code: x <- loadWorkbook("x.xlsx") b <- readWorksheet(x, sheet="b") The first line works fine, however, running the second gives the following error: Error in (function (classes,…
mallet
  • 2,454
  • 3
  • 37
  • 64
11
votes
2 answers

Possible to write Excel formulas or data validation using R?

I am trying to write a R data frame to Excel and want to add additional cells/columns that have Excel formulas and/or data validation values (e.g. using the Data/Validation menu in Excel to provide drop-down lists of allowable values for a…
Mac471
  • 423
  • 5
  • 16
10
votes
1 answer

Importing .xlsx file with special characters

I am using the function readWorksheet from the package XLConnect to import Excel sheets in R. These sheets contain special characters (e.g., ø, õ, ú) which R does not handle very well. As far as I know, there is no "encoding" argument for the…
jvddorpe
  • 315
  • 1
  • 2
  • 10
9
votes
2 answers

Why R is unable to load a shared object?

I am trying to use XLConnect library in R. If I execute library(XLConnect) I get the following error message: JAVA_HOME cannot be determined from the Registry To resolve this problem I set first the JAVA_HOME…
Roman
  • 124,451
  • 167
  • 349
  • 456
8
votes
5 answers

Error: package or namespace load failed for XLConnect

I'm installing XLConnect library in R studio but, unable to do so. I know that this package has java dependency and my R software and java both are 64 bit. Also, both have configured correctly. I have also installed rJava package before installing…
Rishabh
  • 101
  • 1
  • 4
7
votes
1 answer

Rstudio holds Excelfile permission - XLconnect

Since I updated RStudio last day I cannot get Rstudio to drop it's hold on my excelfiles. I've tried the following to no avail: unlink(fileName, recursive = TRUE) file.info(fileName) file.remove(fileName) file.info gives the following: size…
ErrantBard
  • 1,421
  • 1
  • 21
  • 40
7
votes
1 answer

Package for connecting R and Excel without the Java Virtual Machine

A couple of months ago I found on the Internet information about an R package to connect R with Excel and the other way around (doing basically what xlsx and XLConnect do). However, the main difference with respect to the two above mentioned…
Stefano Lombardi
  • 1,581
  • 2
  • 22
  • 48
7
votes
1 answer

Installing R library XLConnect on OS 10.8.2

XLConnect is, as the manual describes it, "a package that allows for reading, writing and manipulation of Microsoft Excel files from within R". Installation on Windows and Linux is straightforward. Simply tell R to install.packages("XLConnect"), and…
user1322720
6
votes
2 answers

How to download an .xlsx file in R and load the data into a dataframe?

I'm trying to download an .xlsx file from the eia and getting the following error. The error is: "Error: ZipException (Java): invalid entry size (expected 2385 but got 2390 bytes)" I have tried the following code: library(XLConnect) tmp =…
user2946746
  • 1,740
  • 3
  • 21
  • 36
1
2 3
15 16