You were using 'rownames' incorrectly.  Here is the correct way:


library(XLConnect)
wb <- loadWorkbook("writeWorksheet.xlsx", create = TRUE)
createSheet(wb, name = "CO2")
writeWorksheet(wb, CO2, sheet = "CO2",rownames="Row Names")
saveWorkbook(wb)




Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.


On Tue, Jun 17, 2014 at 12:20 PM, Knut Krueger <rh@knut-krueger.de> wrote:

> Any Idea to prevent the warning message?
>
> library(XLConnect)
> wb <- loadWorkbook("writeWorksheet.xlsx", create = TRUE)
> createSheet(wb, name = "CO2")
> writeWorksheet(wb, CO2, sheet = "CO2",rownames=c("",1:84))
> saveWorkbook(wb)
>
> Warning message:
> In names(res)[1] <- colname :
>   number of items to replace is not a multiple of replacement length
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]

