Questions tagged [readxl]

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

readxl
142 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4 votes
1 answer
5k views

Dealing with xlsm with R

I am trying to deal with an official .xlsm file provided officially by a earthquake research center. You can download the file from theXLSM. What I am trying to do is to code R that change specific ...
olk's user avatar
  • 61
4 votes
0 answers
182 views

readxl fails to read all columns of excel 1997-2003 workbook

I am trying to read all EU weekly oil bulletin data files from this source http://ec.europa.eu/energy/observatory/reports, specifically all xls-files with "raw_data" in the file name. library(rvest) ...
GypsyEyes's user avatar
4 votes
2 answers
7k views

read_excel () and lapply()

I have a .xlsx file has two sheets and I want to generate a list of both excel sheets using read_excel from readxl package . I have used this code my_work <- lapply(excel_sheets("data.xlsx"), ...
Bahgat Nassour's user avatar
4 votes
0 answers
564 views

Read multiple excel spreadsheets into R using readxl and correct variable types

I have several excel files that I am trying to read into R using the package readxl. The excel files consist of several tabs each of 60000 rows having four columns of variables. The first column is ...
James Theobald's user avatar
3 votes
0 answers
702 views

Reading data directly from Binary Large OBject (BLOB)

I'm trying to create a SQLite database to store (XLS) files for my Shiny app. Idea is that people would not have to re-upload their content each session - it will be saved and waiting for them. I want ...
Kamil Sijko's user avatar
3 votes
2 answers
155 views

Issues consolidating multiple .xlsx files, column-wise, with junk text before header using R package: readxl and writing to a csv

I am very new to R and programming in general and need help with lining up data contained in ~2000 .xls and .xlsx files. Each file begins with a range of 34 - 40 rows of "junk" text before the header;...
Jerry Miner's user avatar
2 votes
1 answer
674 views

How to prevent the loss of leading zeros when importing data via read_excel?

I have a problem with detection of the column types when importing data into R using the read_excel function of readxl package. There are lot's of Q&As that are similar to my issue like this or ...
Davit Bidzhoyan's user avatar
2 votes
0 answers
111 views

Export multiple workbook from R

Using below image to showcase what I am trying to do. So basically I have 2 workbook with 2 sheets at a location. I want to read them in R & perform two operation (Change 0 to NA & get average ...
Vaibhav Singh's user avatar
2 votes
0 answers
478 views

Pass parameter skip=1 in readxl::read_excel() leads to last empty column missing

Given a sample excel file from this link, I attempted to use readxl::read_excel to read files while skipping headers and renaming with new names. The code below works just fine for Sheet2 with no ...
ah bon's user avatar
  • 9,737
2 votes
1 answer
124 views

R - for view_html() how can I change the limit to more than 100

I am trying to compare two data sets df1 and df2, both having 1000 rows and 161 columns which I have loaded from Excel. When I use compare_df(df1, df2) and then try to view the HTML output by ...
kaydee's user avatar
  • 87
2 votes
2 answers
1k views

Reading from Sharepoint to R keeps throwing 403 Forbidden

I've tried all the different ways I could find on Stack Overflow but they all throw 403 Forbidden error. Some of the codes I've tried: library(RCurl) webpage <- getURL("https://companyname....
DJL's user avatar
  • 144
2 votes
0 answers
124 views

readxl or tidyxl: Prevent date coersion when reading from Excel xlsx

Is there any way to prevent coercion of dates when reading data from Excel? I'm using either the readxl package or the tidyxl package. The tidyxl package is terrific, but it automatically moves the ...
hackR's user avatar
  • 1,459
2 votes
0 answers
662 views

read_excel() reading numeric type column as date type unless it's specified in col_types

I have a table in Excel with numeric, date, and character type columns. I use the read_excel() function from readxl library to load data into R. For most of the columns, read_excel by default does a ...
JohnR's user avatar
  • 57
2 votes
0 answers
1k views

Error read_xlsx (v1.0): Error in read_fun(path = path, sheet = sheet, limits = limits, shim = shim, : std::bad_alloc

I have Rstudio Version 1.1.447/R 3.4.4 on my Mac and have been running this code with no problems in my script: NCBI16S<-read_xlsx("accession_taxon_16s.xlsx") This is with readxl version 1.1.0. ...
Gina's user avatar
  • 71
2 votes
1 answer
463 views

Read excel data as is using readxl in R

I have to read an excel file in R. The excelfile has a column with values such as 50%,20%... and another column with dates in the format "12-December-2017" but R converts both the column datas. I am ...
Aakash 's user avatar
2 votes
0 answers
1k views

import formulas as values using readxl::read_excel

I have a .xlsx spreadsheet with 2 sheets. This is a screenshot of the first sheet: And this is a screenshot of the second sheet. Note that cell A2 is a value: And this is a screenshot of the second ...
luciano's user avatar
  • 13.5k
1 vote
0 answers
581 views

readxl::read_excel() read excel file path containing Chinese characters returns in utils::unzip(zip_path, list = TRUE)

After setting locale and main path with code below: Sys.setlocale(category = "LC_CTYPE", locale = "chinese") setwd('D:/lyz用户名/R可视化/') I used readxl::read_excel() and xlsx::read....
ah bon's user avatar
  • 9,737
1 vote
1 answer
495 views

R: read in multiple .xlxs files from AWS S3

I am quite new to R and I have a problem which I think needs solving by a loop... I have multiple .xlsx files in AWS S3: (note the naming of each do not follow a pattern) File name 1: climate_change....
fe108's user avatar
  • 449
1 vote
0 answers
84 views

How to append a single cell from excel as a column in R

I am trying to combine multiple excel files in the same folder that all have the same layout. I have successfully pulled all the data from A13:M28 and have been able to append the rows to one big ...
Cooper Youngs's user avatar
1 vote
1 answer
288 views

Read multiple “.xlsx” files

I am trying to read multiple excel files under different folders by R Here is my solution: setwd("D:/data") filename <- list.files(getwd(),full.names = TRUE) # Four folders "...
Clare Su's user avatar
1 vote
0 answers
79 views

Read_excel having trouble with filepaths

I have a list of file paths saved in a character called pwb_files_e1. Some of the pathways have apostrophes in the string. I have a fairly long for-loop that goes through the various files, saves ...
SucculentOtter's user avatar
1 vote
1 answer
1k views

How do I get R to work with spaces in a file path?

I believe a switch to OneDrive is causing some issues in various packages in R due to spaces being incorporated into the file path name. One shown below is the readxl package. Is there a way to get ...
Scott R's user avatar
  • 185
1 vote
0 answers
378 views

How can I get readxl::read_xls to read the first column of this dataset correctly?

The first column is not being read correctly by readxl::read_xls: download.file("http://www.econ.upf.edu/~michael/bioenv.xls", "~/Downloads/bioenv.xls") head(readxl::read_xls("...
jtr13's user avatar
  • 1,245
1 vote
1 answer
124 views

Boolean is transformed to Date R

I have a big excel file (xls) with different columns. Columns that contain "Yes" or "No" are transferred to 1899-12-31 or 1900-01-01 when read in with "read_xls". In the ...
Eddytheturtle's user avatar
1 vote
1 answer
578 views

read_excel in R results in certain floating numbers for column with mix of numeric and text values

I am reading an excel sheet into R using the readxl::read_excel function. While largely this has been a successful have been noticing an issue with certain columns. Uploaded a demo file in the File ...
user5249203's user avatar
  • 4,548
1 vote
1 answer
1k views

r read_xlsx() tacks cell number to the end of column names

I'm trying to import some data from Excel into R using read_xlsx(). I normally like to use janitor::clean_names() to make column names uniform and to tidy the data. This is the code I used: file_two &...
Isaac Noble's user avatar
1 vote
0 answers
307 views

R read_xlsx Adds Trailing Digit to Character

I am reading an Excel file into R using the read_xlsx function from the readxl package. Some of the columns could be "numerics" in Excel, but I convert everything to a character as I read ...
Nick Criswell's user avatar
1 vote
1 answer
111 views

Readxl changes values with negative numbers

I am quite new to data science and just started a project. I have to convert Excel files to a dataframe I can use for this project. I would not like to do some VSB stuff to conver the Excel files but ...
RVB's user avatar
  • 11
1 vote
1 answer
1k views

Reading .xls-file in R

I am trying to read a .xls-file into a R dataframe. I've tried: library(readxl) dfTest <- readxl::read_excel("file_path/file.xls") Which gives me: Error: filepath: file_path/file.xls ...
Michael's user avatar
  • 31
1 vote
1 answer
7k views

Expecting numeric Error while importing data

while I try to import my dataset from excel on R using readxl::read_excel, I receive this error: 1: In read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet, ... : Expecting numeric in ...
Ame's user avatar
  • 93
1 vote
0 answers
236 views

How to Read in xls file that requires permission to open in R

I have several xls files I need to read in and combine into one dataframe. I try df <- readxl::read_excel("file.xls") or df <- readxl::read_xls("file.xls") but neither works. I get the ...
Jacob's user avatar
  • 412
1 vote
0 answers
1k views

R read_excel failed to open file

I get an error when running this code file.lista <- list.files(pattern="*.xls") dados_lista <- lapply(file.lista, read_excel) Error in read_fun(path = path, sheet_i = sheet, limits = limits, ...
Nuno Caleia's user avatar
1 vote
0 answers
295 views

Error loading tidyverse after installing readxl package

I downloaded readxl package from CRAN, to read some excel file for processing in R. Unfortunately, I noticed that tidyverse could not load anymore. It kept displaying the error message below: Error: ...
Edjo Okonubin's user avatar
1 vote
0 answers
4k views

Error in read_fun(path = path, sheet = sheet, limits = limits, shim = shim

I am trying to read xls file using read_excel function of readxl package in R. But it is showing error as Error in read_fun(path = path, sheet = sheet, limits = limits, shim = shim). I tried ...
navneet pande's user avatar
1 vote
0 answers
9k views

R file won't knit, saying readxl package doesn't exist

I'm using RStudio, and trying to knit my file to hand in my assignment. I installed the package "readxl" to read in a couple of excel files, and it worked fine in the actual coding of the assignment. ...
user8834671's user avatar
1 vote
1 answer
5k views

read_excel error: Error in read_fun(path = path, sheet = sheet, limits = limits, shim = shim, : std::bad_alloc

I'm trying to read in some very messy xls workbooks. The workbooks contain merged cells, hidden rows/columns, grouped rows/columns, and macro buttons. I have been able to read in other sheets from the ...
Johnny Atlis's user avatar
1 vote
0 answers
2k views

Reading mixed numeric and text columns with read_excel() from the readxl package

I'm trying to ingest a large collection of legacy Excel 97-2003 files (.xls) using read_excel() from the readxl package. One of the columns in these files is an alphanumeric code with some blanks (e.g....
tcquinn's user avatar
  • 403
1 vote
3 answers
339 views

read in xls file in r from business objects

I have downloaded a xls file from business objects and want to read it in R. I have tried several options, the easiest one being: library("readxl") txt=read_excel("file.xls", sheet = 2) The problem ...
Piet Hein's user avatar
0 votes
1 answer
35 views

Open a selected baseline in read only mode

I would like to open a selected baseline of a module. Here is the code that I use to open any selected DOORS module. Please follow the given steps: Select a DOORS module dynamically in a explorer ...
NickHalden's user avatar
0 votes
0 answers
48 views

How to use csvkit in R?

I have a .xlsx file (~70MB) (it's the 2022 National Youth Tobacco Survey data) that I'd like to read into R. I am trying to find a faster way than read_excel from readxl to read the file. > system....
Cloft X's user avatar
  • 454
0 votes
0 answers
33 views

How do I avoid Error normalizePath with read_excel in R?

I was trying to import table from excel (xlsx) to my R, but I get an error Warning message: In normalizePath(path.expand(path), winslash, mustWork) : path[1]="Data_202310.xlsx": Access is ...
Kyoto's user avatar
  • 53
0 votes
1 answer
38 views

Read different excel files with a range of sheet

I have a file per month and within there are different sheets (2:7) that group days in the given month. I need to merge all of that into a single dataframe. I made a for loop but it only save the ...
Ariel's user avatar
  • 155
0 votes
1 answer
34 views

Readxl makes empty cells into blank tibbles--work around by replacing with NAs

I know this in an active issue with readxl (here), but it hasn't been resolved, so I'm looking for a work-around that works for my specific situation, since it's a little different than most questions ...
kswp's user avatar
  • 35
0 votes
1 answer
423 views

R loop to extract data from excel files and save outputs in separate dataframes

I would like to loop through a set of excel files in a folder (let's imagine the folder contains 5 excel files). Each excel file contains different data but with the same structure, that looks like ...
Rbeginner's user avatar
0 votes
1 answer
49 views

Classifying excel workbooks based on "string name" at specific location of excel sheet

I am working with ~30 excel workbooks containing data with different set of designs. However, excel sheets within workbook are well formatted. # There is a pattern, wherein if we have string "...
Samarth's user avatar
  • 25
0 votes
1 answer
30 views

Transferring values from specific columns into first empty column

There are many NA's in my dataframe and I need to transfer those cells (at row level) to the left. I have a dataframe as follows: A1 A2 A3 A4 A5 A6 Abc NA Xyz NA 123 123 Cde NA NA Mno 756 888 NA ...
alf001's user avatar
  • 13
0 votes
0 answers
47 views

Why are undesired sheets being read into my list with lapply()

Full disclosure- I inherited this code and tried to Frankenstein it enough to make it work. It isn't perfect. I have a series of Excel workbooks I'm iterating through to extract financial data for a ...
JKA99's user avatar
  • 9
0 votes
1 answer
3k views

Reading excel file from a custom path: error `path` does not exist

I am trying to read bunch of Excel files from a directory, which is not the working directory. I am trying this, library(readxl) file.list <- list.files(path = "05_TT/Output/", pattern='*....
JontroPothon's user avatar
0 votes
1 answer
25 views

R file referencing not working in the context of readxl::read_excel function

What I am trying to do is go up three folders to the "New Model Setup" Folder, within that folder I am attempting to go down into the "Data Inputs" Folder and access my excel file. ...
STATMATT's user avatar
0 votes
1 answer
48 views

How to import xls column with postal codes as character, not numeric

I have a excel sheet with US states and their Postal codes, when I import the file with read_xls function the Postal codes are coerced into numbers and codes which have 0 starting of the code are gone....
Nava Ajay Shankar A's user avatar