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

Cannot save tible with row.names = FALSE #129

Open
david-cortes opened this issue May 15, 2019 · 3 comments
Open

Cannot save tible with row.names = FALSE #129

david-cortes opened this issue May 15, 2019 · 3 comments

Comments

@david-cortes
Copy link

Steps to reproduce:

  • Create some data.frame with several columns.
  • Convert said data.frame to tibble (which for example, happens implicitly when doing operations on it with dplyr).
  • Try to save the object to an excel file without row names, e.g.
xlsx::write.xlsx(tibble_obj, "excel_file.xlsx", row.names = FALSE)

Expected behavior: should save the file normally.

Actual behavior: throws the following error:

Error in .jcall(cell, "V", "setCellValue", value) : 
  method setCellValue with signature ([D)V not found
In addition: Warning message:
In if (is.na(value)) { :
  the condition has length > 1 and only the first element will be used

But note that the following do not produce any error:

xlsx::write.xlsx(as.data.frame(tibble_obj), "excel_file.xlsx", row.names = FALSE)
xlsx::write.xlsx(tibble_obj, "excel_file.xlsx", row.names = TRUE)

Setup: xlsx 0.6.1, R 3.5.1, openjdk 11.0.2, running on windows 10.

@phineas-pta
Copy link

it's still relevant today: xlsx 0.6.5, R 4.2, openjdk 17, windows 11

@lillianhorin
Copy link

I received this error today as well, with the same solutions as in @david-cortes ' post.

@pablopalamarchuk
Copy link

Same here. %>% as.data.frame() %>% solve the issue. W11 R 4.2.3

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

4 participants