1

I need to create a table with some merged cells, you can consider it as a normal dataframe with 10 columns, 1:3 columns will be described on top using a merged cell, and another for 4:10 columns.

Is there any package in R for me to do? like xtable?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
lokheart
  • 23,743
  • 39
  • 98
  • 169
  • 1
    What format do you want to have for the output? Text? Latex? HTML? ... – Aniko Jan 07 '11 at 14:10
  • @aniko, currently i am using sword to push the data directly to word, outout as WORD is perfect, if not, HTML will do also. – lokheart Jan 10 '11 at 01:26
  • as you need a Word document, I think the solution with odfWeave could be perfect for you (see below), as Ms Office can open the odt format (from the 2007 version SP2). – daroczig Jan 10 '11 at 13:08
  • http://stackoverflow.com/questions/19069468/r-remove-repeating-row-entries-in-gridextra-table – Sonia Sep 28 '15 at 18:46

1 Answers1

4

You can do it in Open Document Format (readable, editable in OpenOffice or Ms Office) with odfWeave package.

Example from documentation (see formatting.odt in package source/inst/examples):

library(odfWeave)
set.seed(416)
tableData <- state.x77[c(7, 38, 20, 46), c(7, 1, 8)]
states <- data.frame(type = c("Northern", "Southern"),
                     pos = c(2, 2),
                     text = "ArialCenteredItalics")

odfTable(tableData, rgroup = states)
odfTableCaption("a table using multi-cell row headers")
daroczig
  • 28,004
  • 7
  • 90
  • 124