Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing columns due to blank cells underneath column header #40

Closed
chrisaxelson opened this issue Mar 27, 2015 · 5 comments
Closed

Missing columns due to blank cells underneath column header #40

chrisaxelson opened this issue Mar 27, 2015 · 5 comments

Comments

@chrisaxelson
Copy link

Thanks so much for a great (and speedy) package!

Just to let you know that the read_excel function doesn't seem to import columns if the initial data in those columns are blank. The xlsx in the link has 295 columns but only the first column is imported. The rows aren't blank as the first column does contain data.

I see you're discussing anchors and specifying ranges which would make it possible to manually identify, but it might still be useful if the default brought it all in.

library(readxl)
download.file("https://www.resbank.co.za/Lists/News%20and%20Publications/Attachments/6648/01Kbp1%20%E2%80%93%20Money%20and%20Banking%20%E2%80%93%20March%202015.zip", "Banking_data.zip")
unzip("Banking_data.zip")
ncol(read_excel("Kbp1MB-March2015.xlsx", sheet = "M1"))
#2

Thanks again for all your hard work!

@hadley
Copy link
Member

hadley commented Apr 7, 2015

This seems to be ok now:

 tail(read_excel("~/Desktop/Kbp1MB-March2015.xlsx"))
           NA KBP1434D KBP1437D KBP1438D KBP1440D KBP1456D KBP1457D
5299 20150131     2561    37800        0    40717     1256      900
5300 20150202        0    37800        0    41881     4583      502
5301 20150203        0    37800        0    40790     3230      241
5302 20150204        0    37500        0    40619     3363      244
5303 20150205        0    37500        0    38806     1611      305
5304 20150206        0    37500        0    37940     1433      993

@hadley hadley closed this as completed Apr 7, 2015
@chrisaxelson
Copy link
Author

Hi Hadley,

Sorry I'm really not trying to be a pain - it's the fourth sheet in the xlsx file that has the issue. There are 295 columns but code will import first 2 only.

tail(read_excel("~/Desktop/Kbp1MB-March2015.xlsx"), sheet = 4)

Thanks again for all your work on readr, readxl and haven lately!

@hadley hadley reopened this Apr 13, 2015
@reinierv4
Copy link

I have a similar problem. When I try to read in a .xls file downloaded and saved from the internet R reads in the file without the last column. When I manually open and save my excel file and try to read in the file again this problem disappears. This is however not a feasible workaround because of the amount of files I have to process. Would be great if somebody has a solution!

@hadley
Copy link
Member

hadley commented May 14, 2015

@reinierv4 please file a new issue with a minimal reproducible example (i.e. including a link to the file to download)

@reinierv4
Copy link

Hi Hadley, thanks a lot for your quick response. I created a new issue: #99

@jennybc jennybc closed this as completed Jan 21, 2017
@lock lock bot locked and limited conversation to collaborators Oct 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants