# roxygen generated flag
options(R_CHECK_RUNNING_EXAMPLES_=TRUE)
# create a completely empty NMF object
new('NMFOffset')
# 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='NMFOffset', W=w, H=h, offset=rep(0.5, nrow(w)))
# apply Nonsmooth NMF algorithm to a random target matrix
V <- rmatrix(n, p)
if (FALSE) nmf(V, r, 'offset')
# random NMF model with offset
rnmf(3, 10, 5, model='NMFOffset')
Run the code above in your browser using DataLab