opt <- options()
# define some special formats for count data, percentages and numeric results
# (those will be supported by TOne)
options(fmt.abs=structure(list(digits=0, big.mark="'"), class="fmt"))
options(fmt.per=structure(list(digits=1, fmt="%"), class="fmt"))
options(fmt.num=structure(list(digits=1, big.mark="'"), class="fmt"))
TOne(x = d.pizza[, c("temperature","delivery_min","driver","wine_ordered")],
grp=d.pizza$quality)
# define median/IQR as describing functions for the numeric variables
TOne(iris[, -5], iris[, 5],
FUN = function(x) gettextf("%s / %s",
Format(median(x, na.rm=TRUE), digits=1),
Format(IQR(x, na.rm=TRUE), digits=3))
)
options(opt)
-- Send the whole stuff to Word
wrd <- GetNewWrd()
ToWrd(TOne(x = d.pizza[, c("temperature","delivery_min","driver","wine_ordered")],
grp=d.pizza$quality))
Run the code above in your browser using DataLab