Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 15th, 2012  |  syntax: None  |  size: 0.37 KB  |  hits: 7  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Pass a formula to an xls file using R's xlsx package
  2. library(xlsx)
  3. wb <- loadWorkbook('D:/test.xls')
  4. sheets <- getSheets(wb)
  5. sheet <- sheets[['my_sheet']]
  6.  
  7. addDataFrame(x = ds, sheet = sheet, row.names = FALSE, col.names = FALSE, startRow=3, startColumn=1)
  8.  
  9. cell.1 <- createCell(rows[1], colIndex=34)[[1,1]]
  10. setCellValue(cell.1, "=A32*B33")
  11. saveWorkbook(wb, 'D:/test.xls')