This function converts an xtabs object to a matrix.
Usage
"as.matrix"(x, ...)
Arguments
x
an object of class xtabs
...
additional arguments to be passed to or from methods.
Details
xtabs is indeed already a matrix, but won't be converted to a pure matrix by as.matrix.default function, as its classes definition will remain unchanged. Some functions expecting a pure matrix may fail, when fed with a xtabs object.
as.matrix.xtabs will kill the classes and the call attribute.
Note that unclass would as well discard the classes xtabs and table, but retain the "call" attribute.