Displaying 1 result from an estimated 1 matches for "makedimnames".
2014 Jan 10
0
proposal: stats::as.matrix.ftable method
...il.ftable*
Non-visible functions are asterisked
>
The function below was proposed by William Dunlop:
# as.matrix method for flattened tables
# modified from Willaim Dunlop, <wdunlap at tibco.com>, R-Help, 01-09-2014
as.matrix.ftable <- function(x, sep="_", ...) {
makeDimNames <- function(vars) {
structure(
list(do.call(paste, c(rev(expand.grid(rev(vars))),
list(sep=sep)))),
names = paste(collapse=sep, names(vars))
)
}
structure(
unclass(x),
dimnames=c(makeDimNames(attr(x, "row.vars")),...