# roxygen generated flag
options(R_CHECK_RUNNING_EXAMPLES_=TRUE)
# create a completely empty NMFns object
new('NMFns')
# create a NMF object based on random (compatible) matrices
n <- 50; r <- 3; p <- 20
w <- rmatrix(n, r)
h <- rmatrix(r, p)
nmfModel(model='NMFns', W=w, H=h)
# apply Nonsmooth NMF algorithm to a random target matrix
V <- rmatrix(n, p)
if (FALSE) nmf(V, r, 'ns')
# random nonsmooth NMF model
rnmf(3, 10, 5, model='NMFns', theta=0.3)
Run the code above in your browser using DataLab