readxl

Issues with installing readxl package

為{幸葍}努か 提交于 2019-12-11 07:16:38
问题 I am trying to install the new readxl package on a Windows 64 bit machine. I tried the following commands for the installation install.packages("devtools") library(devtools) install.packages("Rcpp") library(Rcpp) install_github("hadley/readxl") I get the following error with the install_github command: Installing github repo readxl/master from hadley Downloading master.zip from https://github.com/hadley/readxl/archive/master.zip Installing package from C:\Users\RAVISH~1.R\AppData\Local\Temp

Reading multiple xlsx files each with multiple sheets - purrr

不羁岁月 提交于 2019-12-11 02:35:34
问题 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 this. I keep thinking that I could have done it with map2 but I am missing something. library(tidyverse) library(readxl) library(writexl) ### As a first step, I get all the files from my project folder and create an empty list for looping purposes

read_excel read in messages- Suppress?

主宰稳场 提交于 2019-12-07 18:08:39
问题 I love using the readxl package. However, I've been using it as part of an RMarkdown document and some of the read_excel() message when reading in files are useful when doing analysis but not when trying to present the analysis. So the question is, is there any way to suppress the message received (or any warning message for that matter) when using read_excel ? I'll take an RMarkdown OR read_excel solution. Here is an illustration of the type of message I'd like to suppress. The appears in my

R read excel by column names

淺唱寂寞╮ 提交于 2019-12-02 00:40:37
问题 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 <- list() for (i in wb){ dflist[[i]] <- data.frame(read_excel(i, sheet = "SheetName", skip=3, col_names = TRUE)) } # now put them into a data frame data <- ldply(dflist, data.frame, .id = NULL) This works (barely) but the problem is my excel files have

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

拥有回忆 提交于 2019-12-01 15:03:00
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 sheets_fun(path) : Evaluation error: zip file './data/file.xlsx' cannot be opened. Any ideas? The error message is readxl 's funny way of saying "file not found". That exact line of code gives me the exact same error, and the file doesn't even exist for me. Note: I'm on version 1.0.0 of readxl I had this error, but for me, it was just that I had the sheet open in

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

怎甘沉沦 提交于 2019-11-30 07:23:17
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 so far. I would like R to read in multiple xlsx files with that have multiple sheets. All sheets and files have the same columns but not the same length and NA's should be excluded. I want to skip the first 3 rows and only take in columns 1:6, 8:10, 12:17, 19. So far I tried: file.list <- list.files(recursive=T,pattern='*.xlsx') dat = lapply(file

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

一世执手 提交于 2019-11-29 22:33:21
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 class (datatype) to sparsely populated columns. For example, a given column may be NA for 20,000 rows and then will take a character value on row 20,001. read_excel() appears to default to column type numeric when scanning the first n rows of a column and finding NAs only. The data causing the problem are chars in a column assigned numeric. When the

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

混江龙づ霸主 提交于 2019-11-28 19:15:35
问题 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 class (datatype) to sparsely populated columns. For example, a given column may be NA for 20,000 rows and then will take a character value on row 20,001. read_excel() appears to default to column type numeric when scanning the first n rows of a

Read Excel file from a URL using the readxl package

吃可爱长大的小学妹 提交于 2019-11-27 15:32:45
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 fails) url1<-'https://evs.nci.nih.gov/ftp1/CDISC/SDTM/SDTM%20Terminology.xls' p1f <- tempfile() download.file(url1, p1f, mode="wb") p1<-read_excel(path = p1f, sheet = 2) This works for me on Windows: library(readxl) library(httr) packageVersion("readxl") # [1] ‘0.1.1’ GET(url1, write_disk(tf <- tempfile(fileext = ".xls"))) df <- read_excel(tf, 2L) str(df) #

Read Excel file from a URL using the readxl package

与世无争的帅哥 提交于 2019-11-26 14:45:29
问题 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 fails) url1<-'https://evs.nci.nih.gov/ftp1/CDISC/SDTM/SDTM%20Terminology.xls' p1f <- tempfile() download.file(url1, p1f, mode="wb") p1<-read_excel(path = p1f, sheet = 2) 回答1: This works for me on Windows: library(readxl) library(httr) packageVersion("readxl