Hi all, I try to print a table with the grid.draw(tableGrob(...)) function applied to an ftable object. The output only give me a table without colnames either rownames, but with edit.grid() I can add only one of them. And this is the problem, I have a table with a two rows head, like this: 45 o mas Entre 25 y 45 HOMBRES MUJERES TOTAL HOMBRES MUJERES TOTAL TOTAL AGRICULTURA 42 192 234 50 198 248 523 COMERCIO 221 307 528 479 1033 1512 2317 CONSTRUCCION 1143 54 1197 1679 141 1820 3220 HOSTELERIA 150 327 477 233 536 769 1365 INDUSTRIA 207 120 327 322 171 493 892 RESTO DE SERVICIOS 633 1322 1955 989 1917 2906 5289 SIN ACTIVIDAD ECONOMICA 114 509 623 98 176 274 1043 TOTAL 2510 2831 5341 3850 4172 8022 14649 And the question is, if there is a way to add the two head rows with the edit.grid function or other function to use with an ftable object that prints all the head columns. Thanks in advance Victor -- View this message in context: http://r.789695.n4.nabble.com/grid-table-with-head-of-two-rows-tp3219992p3219992.html Sent from the R help mailing list archive at Nabble.com.
Here is a more clear example: # Create the ftable object oftable<-ftable(Titanic, row.vars = 4,col.vars=c(2,3)) require(gridExtra) #Draw the grid, but the rows and heads are missing grid.draw(tableGrob(oftable, show.csep=TRUE, show.rsep=TRUE, show.box=TRUE, separator="grey", name="table2headrows")) # I only can add 1 head and row labels grid.gedit("table2headrows", cols=attributes(oftable)$col.vars$Sex, rows=attributes(oftable)$row.vars$Survived, gpar.corefill = gpar(fill="white", col=NA), grep=TRUE, global=TRUE) -- View this message in context: http://r.789695.n4.nabble.com/grid-table-with-head-of-two-rows-tp3219992p3224772.html Sent from the R help mailing list archive at Nabble.com.