Questions tagged [readxl]

an R package that can be used to import Excel (.xls and .xlsx) files into R

The readxl package can be used to import Excel (.xls and .xlsx) files into R. It has no external dependencies (the libxls C library is embedded) and works on Windows, Mac, and Linux.

Resources

257 questions
22
votes
14 answers

Reading Excel: evaluation error with zip file '..file.xlsx' cannot be opened

I am using R with readxl package. I try to import an Excel file with the following command: library(readxl) city_codes <- read_excel("./data/file.xlsx", sheet = "city_codes") It says it is a zip file and cannot be opened: Error in…
canpoint
  • 595
  • 2
  • 6
  • 18
20
votes
4 answers

Read Excel file from a URL using the readxl package

Consider a file on the internet (like this one (note the s in https) https://evs.nci.nih.gov/ftp1/CDISC/SDTM/SDTM%20Terminology.xls How can the sheet 2 of the file be read into R? The following code is approximation of what is desired (but…
userJT
  • 9,328
  • 17
  • 65
  • 82
18
votes
6 answers

Specifying Column Types when Importing xlsx Data to R with Package readxl

I'm importing xlsx 2007 tables into R 3.2.1patched using package readxl 0.1.0 under Windows 7 64. The tables' size is on the order of 25,000 rows by 200 columns. Function read_excel() works a treat. My only problem is with its assignment of column…
jackw19
  • 325
  • 2
  • 4
  • 7
12
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
  • 123
  • 1
  • 4
10
votes
2 answers

Fastest way to read large Excel xlsx files? To parallelize or not?

My questions are: What is the fastest way to read large(ish) .xlsx Excel files into R? 10 to 200 MB xlsx files, with multiple sheets. Can some kind of parallel processing be used, e.g. each core reading a separate sheet of a multi-sheet Excel…
Pythonista anonymous
  • 5,770
  • 14
  • 47
  • 87
9
votes
1 answer

New names: * `` -> `..18` message in R console

I ran a Rshiny app and it works as expected but in console I get the following message: New names: * `` -> `..18` what does it mean? It occurs when I try to do this > data1<-read_excel("CUMMULATIVE COLLECTION POS_UPLOAD.xls") New names: * `` ->…
Stupid_Intern
  • 3,036
  • 5
  • 30
  • 63
7
votes
4 answers

Read multiple xlsx files with multiple sheets into one R data frame

I have been reading up on how to read and combine multiple xlsx files into one R data frame and have come across some very good suggestions like, How to read multiple xlsx file in R using loop with specific rows and columns, but non fits my data set…
Elisah
  • 115
  • 1
  • 1
  • 5
6
votes
7 answers

readxl::read_xls returns "libxls error: Unable to open file"

I have multiple .xls (~100MB) files from which I would like to load multiple sheets (from each) into R as a dataframe. I have tried various functions, such as xlsx::xlsx2 and XLConnect::readWorksheetFromFile, both of which always run for a very long…
Brunox13
  • 643
  • 5
  • 15
6
votes
3 answers

Importing xlsx data to R when numbers have a comma as decimal separator

How can I import data from a .xlsx file into R so that numbers are represented as numbers, when their original decimal separator is comma not a dot? The only package I know of, when dealing with excel is readxl from tidyverse. I'm looking for a…
blazej
  • 1,273
  • 9
  • 31
5
votes
0 answers

Reading a password-protected xlsx-file into R without installing Java (password is known)

currently I am preparing an R-lesson for a customer. We want to read in data from a password protected xlsx file. Thus, I am trying to read this password protected xlsx file into R (unprotecting the file itself is no solution). Unfortunately I…
Chris
  • 431
  • 3
  • 7
5
votes
3 answers

readxl, selected worksheets in single .xlsx-workbook

How do I succinctly import selected sheets, preferably using readxl, from a .xlsx-workbook? With the below code (approach # 1) I can import all sheets in a single .xlsx-workbook, but how do I filter() or select() ? The second bit of code, with the…
Eric Fail
  • 7,222
  • 5
  • 61
  • 118
5
votes
1 answer

Machine specific slow read_excel read times

I'm getting really slow read times using read_excel on a particular machine with a particular xlsm file. Reading the same xlsm file across 2 different machines I get read times of 72 seconds versus 0.2 seconds. Where the slower machine actually has…
Will T-E
  • 555
  • 1
  • 5
  • 15
5
votes
3 answers

Error: could not find function "read_excel" using R on Mac

I am trying to link up my excel data set to R for statistical analysis. I am running on OSX Sierra (10.12.6) with R studio (1.0.153) and Java 8 (update 144). The function "read_excel" was able to open my excel document a week ago. When I moved the…
user8760612
  • 53
  • 1
  • 1
  • 4
5
votes
2 answers

read_excel correctly imports file, but "invalid multibyte string" error when trying to put it on a list

When I read any of the sheets from the file Posti-Letto-Istat.xls with read_excel from the readxl package I have no problems: library(readxl) pl_istat1 <- read_excel(path = "data/Posti-Letto-Istat.xls", sheet = 1, range = "A6:I66", na =…
Max
  • 85
  • 7
5
votes
2 answers

Read column names as date format

I have date in Excel as follows, first col1 as char and from col2 to col5 is in date format (mm/dd/yyyy) id 1/1/2016 2/1/2016 3/1/2016 4/1/2016 5/1/2016 1 23 545 33 55 66 2 454 536 66 …
user5860640
  • 61
  • 2
  • 7
1
2 3
17 18