ledghead: Generate a color coded ledgend dataframe via head and sum.
Description
'ledghead' is part 'head' and part 'summary'. It works best on a sorted dataframe where all you are interestesd in only the most (or least) abundant rows.
An ideal place to use it is in a legend for ~lognormally distributed data.
Additionally, an optional row-wise color coding column is added (the color 'gray' is used for missing row names).
Usage
ledghead(x, n=6, colors=TRUE, tabulate=FALSE)
Arguments
x
dataframe or table you wish to summarize
n
The number of rows you wish to display as is.
colors
list of vectors or a dataframe
tabulate
the column name to tabulate on if x is an untabulated dataframe and FALSE otherwise
Value
A truncated dataframe with a new bottom row summarizing all the truncated ones.