dim, nrow, ncol and
nbasis return the different dimensions associated
with an NMF model. dim returns all dimensions in a length-3 integer
vector: the number of row and columns of the estimated
target matrix, as well as the factorization rank (i.e.
the number of basis components).
nrow, ncol and nbasis provide
separate access to each of these dimensions respectively.
nbasis(x, ...) ## S3 method for class 'NMF':
dim(x)
## S3 method for class 'NMFfitXn':
dim(x)
basis and
coef methods, such as an object that inherit from
NMF .dim, a length-3
integer vector, e.g. c(2000, 30, 3) for an
NMF model that fits a 2000 x 30 matrix using 3
basis components.nrow and ncol, but rather the S4 method
dim for objects of class NMF .
This allows the base methods nrow and
ncol to directly work with such objects, to
get the number of rows and columns of the target matrix
estimated by an NMF model. The function nbasis is a new S4 generic defined in
the package NMF, that returns the number of basis
components of an object. Its default method should work
for any object, that has a suitable basis method
defined for its class.