DropEmpty pseudo-function
Pseudo-function to indicate that rows or columns containing no observations should be dropped.
DropEmpty(empty = "", which = c("row", "col", "cell"))
empty |
String to use in empty cells. |
which |
A vector indicating what should be dropped. See the Details below. |
If the which
argument contains "row"
, then
any row in the table in which all cells are empty will be dropped.
Similarly, if it contains "col"
, empty columns
will be dropped. If it contains "cell"
, then cells
in rows and columns that are not dropped will be set to
the empty
string.
This is a “pseudo-function”: it takes the form of a function call, but is
never actually called: it is
handled specially by tabular
.
df <- data.frame(row = factor(1:10), value = rnorm(10)) subset <- df[sample(10, 5),, drop = FALSE] # Some rows did not get selected, so this looks ugly tabular(row ~ value*mean, data = subset) # This only shows rows with data in them tabular(row*DropEmpty() ~ value*mean, data = subset) # This shows empty cells as "(empty)" tabular(row*DropEmpty("(empty)", "cell") ~ value*mean, data = subset)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.