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

Error Generated on Importing Empty Sheet #28

Closed
GoogleCodeExporter opened this issue Jul 19, 2015 · 3 comments
Closed

Error Generated on Importing Empty Sheet #28

GoogleCodeExporter opened this issue Jul 19, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

Importing an empty Excel sheet does not contain header names on the first row, 
hence resulting in a generated error.  The read.xlsx(2) function should return 
a NULL object for these cases.

Original issue reported on code.google.com by darde...@gmail.com on 27 Dec 2013 at 3:48

@GoogleCodeExporter
Copy link
Author

Please attach a minimal code example which illustrates the issue. 

If you're trying to read a sheet that does not exist in a spreadsheet, I want 
the code to fail not to return NULL.  The sheet is not there.  If the error 
message is not clear about it, I can improve on that. 

Adrian

Original comment by adrian.d...@gmail.com on 27 Dec 2013 at 4:27

@GoogleCodeExporter
Copy link
Author

Here is the code:

res <- read.xlsx("K:/Troubleshoot.xlsx", 1) #works because first sheet contains 
data
res2 <- read.xlsx("K:/Troubleshoot.xlsx", 2) #generates error because sheet is 
empty.  This should return NULL.  This causes my web application to crash

Original comment by darde...@gmail.com on 27 Dec 2013 at 4:34

Attachments:

@GoogleCodeExporter
Copy link
Author

fixed it in trunk.  Now both read.xlsx, read.xlsx2 return NULL when the sheet 
is empty. 

Thanks, 
Adrian

Original comment by adrian.d...@gmail.com on 13 Feb 2014 at 3:59

  • Changed state: Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant