I want values 7, 8, 9 and 10 to also appear shaded darker in the table below. I have used
grid.table(public)
myt <- ttheme_default(
colhead = list(fg_params=list(col="black"),
bg_params=list(fill="grey")),
rowhead = list(fg_params=list(col="black", fontface="bold",hjust=0.5, x=0.5),
bg_params=list(fill="grey")))
grid.table(cbind("X\\Y"=rownames(public)[1:4], public[1:4,1:4]),rows=NULL)
grid::grid.newpage()
grid.table(public[1:4,1:4], theme=myt)
NEW Now, I can't manage to make the first column bold
myt <- ttheme_default(
colhead = list(fg_params=list(col="black"),
bg_params=list(fill="grey")),
rowhead = list(fg_params=list(col="black", fontface="bold",hjust=0.5, x=0.5),
bg_params=list(fill="grey")))
grid::grid.newpage()
grid.table(public[1:4,1:4], theme=myt)
rs = tableGrob(cbind("X\\Y"=rownames(public)[1:4]), rows=NULL, theme=ttheme_default(core=list(bg_params=list(fill="grey"))))
grid::grid.draw(gtable_combine(rs, tableGrob(public[1:4, 1:4], rows=NULL)))
Perfect with these codes:
grid::grid.newpage()
grid.table(public[1:4,1:4], theme=myt)
rs = tableGrob(cbind("X\\Y"=rownames(public)[1:4]),
rows=NULL,
theme=ttheme_default(core=list(bg_params=list(fill="grey"),
fg_params=list(fontface="bold"))))
grid::grid.draw(gtable_combine(rs, tableGrob(public[1:4, 1:4], rows=NULL)))