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
0
votes
0 answers

Installing old version of Readxl readxl_0.1.1.tar.gz

Im trying to install an old version of Readxl (readxl_0.1.1.tar.gz), with both this options: # Try Number 1 packageurl <- "http://cran.rproject.org/src/contrib/Archive/readxl/readxl_0.1.1.tar.gz" install.packages(packageurl, repos=NULL,…
0
votes
2 answers

How do I remove a portion of the name when saving a file?

I have the following script: Files <- list.files(datapath, pattern = ".txt") # convert all .txt files in the given folder for (i in 1:length(Files)){ dataname <- Files[i] filename <- paste(datapath, dataname, sep="") read_eprime(filename)…
KKhosra
  • 163
  • 1
  • 4
  • 9
0
votes
3 answers

Import multiple sheets from excel spreadsheet into r

I want to import multiple sheets, selected by a common string in the sheet name, from a single .xlsx file and concatenate them into single data frame. For example, if I have an excel file ('data.xlsx') with worksheets named samples1, samples2,…
user42485
  • 751
  • 2
  • 9
  • 19
0
votes
1 answer

R read_excel readxl sometimes incorrectly converts numbers to dates

When I use read_excel to import data from Excel to R, some numeric columns are automatically converted to dates. # e.g. 5600 to 1915-05-01 Is there a way to turn of this feature? Other than using "col_types" argument in read_excel.
LeGeniusII
  • 900
  • 1
  • 10
  • 28
0
votes
1 answer

File name as legitimate column in R data frame

I am combining one sheet from all XLS files in a folder into one data frame & displaying a specific range from all of them, which works fine. However, I want to add the file name as an actual column, which isn't working right now - it displays as…
Gib999
  • 93
  • 1
  • 8
0
votes
1 answer

specify input in function

How to specify the input to be only numeric class in a function in R?. For example, read_data <- function(file_name, sheet, sample_list = stop("'sample_list' must be provided")){ ibrary(readxl) data = read_excel(file_name, sheet = 2) …
PDM
  • 84
  • 10
0
votes
1 answer

Downloading Excel files in R

I am trying to download an Excel file (xls) from the Australia Bureau of Statistics in r with the following code. However, everytime I try to run the line with the read_excel command my session crashes. library(readxl) target <-…
Dom
  • 1,043
  • 2
  • 10
  • 20
0
votes
1 answer

Import in R with column headers across 3 rows. Replace missing with latest non-missing column

I need help importing data where my column header is split across 3 rows, with some header names implied. Here is what my xlsx file looks like 1 USA China 2 Dollars …
0
votes
0 answers

R readxl returning NA values from Excel file

I am having trouble reading data from *.xls files into R. I'm trying to use readxl::read_xls() to read the data in the Microsoft Excel file from following URL:…
bmosov01
  • 589
  • 5
  • 15
0
votes
1 answer

Error in readxl::read_excel: is_null(n) : object 'rlang_is_null' not found

When trying to run the sample code given here: xlsx_example <- readxl_example("datasets.xlsx") read_excel(xlsx_example) I get the error Error in is_null(n) : object 'rlang_is_null' not found Info about my R session: sessionInfo() R version 3.4.2…
Valentin_Ștefan
  • 6,130
  • 2
  • 45
  • 68
0
votes
1 answer

Reading the second excel tabs from multiple Excel workbooks in R

I have troubles with reading data stored in the 2nd tab of multiple Excel spreadsheets which are stored locally. I succeeded to read all the data from the first tab of these spreadsheets using the syntax: library(readxl) filenames2017…
0
votes
0 answers

R import excel with readxl package bug

The problem which I faced: all huge numbers during process of import by readxl converting to "-2147483648". Examples of my "huge" numbers: 45000000000,55000000000. Converting to text in Excel didn't help, defining col_types as "text" either. Is any…
0
votes
1 answer

How to design a function to read multi excel files and make a repetition calculation in R

I have a file contain a multi excel sheet, I want to run a function to read every sheet and subtract one column from another, then calculate a mean I tried library(readxl) average_working_hours <- function(Name) { Name <-…
0
votes
1 answer

Selecting odds/even rows only in R using readxl

My data are as follows: id name age 1 a 45 2 b 47 3 a 49 4 b 51 5 a 53 6 b 55 7 a 57 8 b 59 9 a 61 In order to extract only the odds rows, I tried the following…
Patrick
  • 1,057
  • 9
  • 23
0
votes
2 answers

Dataframes are created but column names are not changing when reading from excel workbook

I am trying to read an excel workbook in R and for each sheet will create a dataframe. In the next step, i want to read that created dataframe and use sheet name along with under score before each of the column in the respective dataframe. Here is…
Madhu Sareen
  • 549
  • 1
  • 8
  • 20