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

Sheet not found by its index in $data but found in $formats #15

Closed
stla opened this issue Feb 19, 2017 · 4 comments
Closed

Sheet not found by its index in $data but found in $formats #15

stla opened this issue Feb 19, 2017 · 4 comments

Comments

@stla
Copy link

stla commented Feb 19, 2017

The weird file: https://www.dropbox.com/s/c1abqpk1ozf6rf1/GBSIextract.xlsx?dl=0

> x <- tidy_xlsx("GBSIextract.xlsx", sheets=1)
> # there's nothing in x$data:
> names(x$data)
character(0)
> names(x$formats)
[1] "local" "style"
> length(x$formats$local$numFmt)
[1] 27

The import works if we provide the sheet name:

> x <- tidy_xlsx("GBSIextract.xlsx", sheets="GBS-Ia")
> names(x$data)
[1] "GBS-Ia"
> dim(x$data$`GBS-Ia`)
[1] 81 20
@stla
Copy link
Author

stla commented Feb 19, 2017

I have another strange case. I don't know whether this is a related issue, but perhaps.

Sheet4 is at second position. This can be seen in Excel, or like this:

> readxl::excel_sheets("++NoteVariab.xlsx")
[1] "Sheet1"  "Sheet4"  "Sheet2"  "Sheet3"  "s a 17"  "s a 0 9"

However:

> txl <- tidyxl::tidy_xlsx("++NoteVariab.xlsx", sheets=2)
> names(txl$data)
[1] "Sheet2"

I will extract a piece of this file before sending it to you, because it is huge.

@nacnudus
Copy link
Owner

@stla May I add GBSIextract.xlsx to this repository for testing? Otherwise I could hack together a test file.

@stla
Copy link
Author

stla commented Feb 20, 2017

Hmmm... at least change the column headers please. It should be enough in order that nobody can identify the source of these data and this is preferable.

@nacnudus
Copy link
Owner

I created a test file from scratch, to be safe.

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

No branches or pull requests

2 participants