0

Recently I was exposed to the grid.table function in the package gridExtra in R. I am simply looking to make my dataframes look "better" than simply printing them to the console.

The default settings work pretty well, but now I am getting greedy. I am asking for help because I am not sure if the following two formatting settings are possible. I read the documentation but am still not sure if this can happen...

  1. Conditionally format/highlight rows and columns if they meet a certain criteria. My thinking was that I could highlight a certain row to make it stand out from the rest of the table.
  2. Is it possible to left alight the first column in the table and center align everything else?

In short, I really like how easy it is to format a dataframe as a table, but now I am hoping I can do a few extra formatting techniques to get the tables to where I need them to be.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Btibert3
  • 38,798
  • 44
  • 129
  • 168

1 Answers1

0

Having just emailed Baptiste the author of gridExtra, that functionality is not currently available.

However, he says that once the gtable package is officially released he is planning to make an update to grid.table which should make it easier to customise the output. But also says not to "hold your breath"...He also however suggested to feel free to use the source code and adapt it.

But I too have been looking for ways to highlight rows in tables and have used the package dprint to do so. Hope that helps.

h.l.m
  • 13,015
  • 22
  • 82
  • 169
  • have a look at the comments on http://code.google.com/p/gridextra/wiki/tableGrob though, there's an earlier version that allowed some highlighting with grid.edit – baptiste Jul 26 '12 at 23:49
  • here is the `dprint` solution to highlight rows...http://stackoverflow.com/questions/11664562/r-dprint-size-of-image-of-table-alteration/11680484#11680484 – h.l.m Jul 27 '12 at 02:00