awalker89/openxlsx — pull request #18 by lbraglia (2014-07-17 11:15:20+00:00)
Title: A new helper function (esistsOrAddSheet) ...

... that allows user to type less (if wanted/needed, aka backward compatible) with writeData. Useful for serial reporting/er (eg one object per sheet)

```R
library(openxlsx)

## usual version
wb <- createWorkbook()
addWorksheet(wb, "Indometh")
writeData(wb=wb, sheet="Indometh", x = Indometh)

## less verbose version (no addWorksheet)
writeData(wb=wb, sheet="Indometh2", x=Indometh)

Indometh3 <- Indometh
## even less verbose (no addWorksheet, no sheet parameter in
## writeData (using object name) )
writeData(wb=wb, x=Indometh3)

openXL(wb)

## numeric sheets are handled... modifying sheet 2 (Indometh2)
writeData(wb=wb, sheet=2, Formaldehyde, startCol=5)

## creating a new sheet (if number is 5, the fourth sheet will
## have name "5". Message gives hints)
writeData(wb=wb, sheet=5, Formaldehyde)

openXL(wb)
```