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

356 questions
40
votes
17 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
  • 817
  • 2
  • 9
  • 19
27
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
  • 11,486
  • 20
  • 77
  • 88
22
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
  • 375
  • 2
  • 4
  • 7
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
17
votes
2 answers

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,382
  • 8
  • 37
  • 74
11
votes
8 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
  • 775
  • 1
  • 7
  • 21
11
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
  • 8,140
  • 20
  • 70
  • 112
8
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,678
  • 3
  • 19
  • 41
7
votes
1 answer

Skip rows while use read_excel or read.excel in R

I have a excel file like this: I try to read it in read.xlsx or read_excel by skipping the second row: library(xlsx) df <- read.xlsx('./data.xls', 'Sheet1') library(readxl) df <- read_excel("./data.xls", sheet = 'Sheet0', skip = 2, col_names =…
ah bon
  • 9,293
  • 12
  • 65
  • 148
7
votes
2 answers

How to skip the second row using readxl

I have been given an excel spreadsheet: column names are in the first row, garbage text is in the second row, and the actual data begins in the third row. I want to use the readxl package to read this into a dataframe, keeping the column names from…
Matthew
  • 4,149
  • 2
  • 26
  • 53
7
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
  • 73
  • 1
  • 1
  • 4
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
  • 6
6
votes
1 answer

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
  • 412
  • 5
  • 13
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
  • 8,191
  • 8
  • 72
  • 128
5
votes
1 answer

R date parsing using read_excel function

When using the read_excel function the dates in the spreadsheet, in the column FuelEventDateTime, are in format "dd/mm/yyyy hr:mm:ss" (example: 03/05/2019 9:19:00 AM) is parsed as a character string with a format like this: example: 43588.849xxxxx…
1
2 3
23 24