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
3
votes
2 answers

Iteratively read, manipulate multiple excel files and append them into one dataframe using R

Under a directory, I have multiple excel files with similar format (you may download sample files from here): I will need to loop files and read_excel(), mutate a new column name with second column name, rename the first and the second column to…
ah bon
  • 9,293
  • 12
  • 65
  • 148
3
votes
1 answer

How to set tibble column types programmatically

I have a tibble from reading a tall XLSX file using: > file = readxl::read_xlsx(filename, "sheetname") An toy example avoiding an actual XLSX file: > file = tibble( + names = c("name1", "name2", "name3"), + values = c(TRUE, 1, "chr") + ) >…
buggaby
  • 359
  • 2
  • 13
3
votes
0 answers

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 to store raw files - currently I am using only…
3
votes
1 answer

Reading Excel file into R using readxl and httr/libxls error: Unable to open file

I'd like to read in sheet 1 of an Excel file from a website Link using the url of the Excel file. I'm on windows 10, R 3.6.1. I'm trying to use the code from Read Excel file from a URL using the readxl package and have also checked out reading…
Robbie
  • 275
  • 4
  • 20
3
votes
2 answers

set ... to na when using read_excel()

I am trying to read in excel files which use three horizontal dots to represent missing values, for example...…
guyabel
  • 8,014
  • 6
  • 57
  • 86
3
votes
1 answer

column in data frame not getting read in properly with read_xls function in R

So I was beginning to perform some statistics on a data frame that I have read in using the read_xls function from the readxl package(version:1.1.0) when I realized R wasn't reading in a column the way I wanted it to. The column has a great deal of…
NBE
  • 641
  • 2
  • 11
  • 33
3
votes
1 answer

Reading multiple xlsx files each with multiple sheets - purrr

I have multiple excel files, each with different worksheets. I have tried to use readxl and map to import it to R. However, I was only able to do it using a for loop. The code below works fine but I would like to know if there is a clever way to do…
3
votes
4 answers

Import excel workbook with multiple sheets

I am looking to import an excel workbook into R with multiple sheets. However, I can't seem to quite make this work. The code I have been using is the following: library(XLConnect) # Read Excel Sheet excel <-…
Daniel Rawlings
  • 183
  • 1
  • 1
  • 8
3
votes
1 answer

R read excel by column names

So I have a bunch of excel files I want to loop through and read specific, discontinuous columns into a data frame. Using the readxl works for the basic stuff like this: library(readxl) library(plyr) wb <- list.files(pattern = "*.xls") dflist <-…
Alex
  • 193
  • 1
  • 2
  • 12
3
votes
1 answer

comparing the date in my excel file with system date

I have an excel file which has two columns start_date and end_date. I want to compare the end_date with the system date but everytime I use this code I get an error: Incompatible methods ("ops.Date", "Ops.POSIXt") for "<" I am reading excel file…
Suraj
  • 41
  • 7
3
votes
3 answers

read_excel won't trim whitespace

I am using the package readxl to load an excel file. As default it should strip the white space however it is not doing so. The file can be downloaded directly from the link below or alternatively it can be downloaded through the website where it is…
Jonno Bourne
  • 1,931
  • 1
  • 22
  • 45
3
votes
2 answers

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; all data under the header has the same…
3
votes
1 answer

Missing data frame column reading excel file into R with readxl

I'm having some trouble reading an xls file into R using the read_excel function from the readxl package. The data frame is generated, but it's missing at least one column, and I get the following message printed several times: fread: wanted 1 got 0…
3
votes
3 answers

RStudio read.xl working directory error

Hi guys I'm having difficulty loading .xlsx into RStudio - I'm not sure why RStudio can't see the file. Am I specifying the path for read_excel() wrong? Any ideas? Pretty new at R. Thanks! Windows 10 (64-bit) Version 0.99.491 & Version…
Justin Lim
  • 61
  • 1
  • 1
  • 3
2
votes
1 answer

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 this. However I am still struggling. Assume, I have an…
1 2
3
23 24