colearendt / xlsx

An R package to interact with Excel files using the Apache POI java library
https://colearendt.github.io/xlsx/
85 stars 32 forks source link

Error when write.xlsx and row.names is set to FALSE #61

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

The chunk of code below works appropriately with the first data frame. However, 
it chokes with the second one manipulated with dplyr.

library(dplyr)
library(xlsx)
example = read.csv('example.csv', sep = '\t')
write.xlsx(example, file = "example.xlsx", row.names = F)
example.summary = group_by(example, language) %>% summarise(texts = n(), tokens 
= sum(words))
write.xlsx(example.summary, file = "example_summary.xlsx", row.names = F)

What is the expected output? What do you see instead?

I get this message

Error in .jcall(cell, "V", "setCellValue", value) : 
  method setCellValue with signature ([Ljava/lang/String;)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

What version of the product are you using? On what operating system?

R version 3.2.0 (2015-04-16) -- "Full of Ingredients"
Rstudio version 0.99.441
dplyr version 0.4.2
xlsx version 0.5.7
xlsxjars version 0.6.1
rJava 0.9-6
Mac OS X 10.10.4

Original issue reported on code.google.com by jmm...@gmail.com on 17 Jul 2015 at 1:09

Attachments:

GoogleCodeExporter commented 9 years ago
I've found this workaround as answer to this issue:
https://code.google.com/p/rexcel/issues/detail?id=55

Original comment by jmm...@gmail.com on 17 Jul 2015 at 1:15