# save all options value
op <- nmf.options();
utils::str(op) # op may contain functions.
nmf.getOption("track.interval") == nmf.options()$track.interval # the latter needs more memory
x <- matrix(runif(50*10), 50, 10) # create a random target matrix
# or define a synthetic data with a hidden pattern using function syntheticNMF (see ?syntheticNMF)
x <- syntheticNMF(50, 5, 10, noise=TRUE)
# perform default NMF computation
res <- nmf(x, 3)
# Toogle on verbose mode
nmf.options(verbose = TRUE)
res <- nmf(x, 3)
# Toogle on debug mode
nmf.options(debug = TRUE)
res <- nmf(x, 3)
# set the error track step size, and save previous value
old.o <- nmf.options(track.interval = 5)
old.o
# check options
utils::str(nmf.options())
# reset to default values
nmf.options.reset()
utils::str(nmf.options())
Run the code above in your browser using DataLab