advanced {NMF} | R Documentation |
Allow the user to get/set/define package NMF specific options in the same way as with
base functions options
and getOption
.
nmf.options(..., runtime = FALSE) nmf.getOption(name) nmf.options.reset() nmf.options.runtime() nmf.models(builtin.only=FALSE)
... |
any options can be defined, using 'name = value' or by passing a list of such tagged values. However, only the ones below are used in package NMF. Further, 'nmf.options('name') == nmf.options()['name']', see the example. |
builtin.only |
a single logical . If TRUE only built-in NMF models
are returned.
|
name |
a character string holding an option name. |
runtime |
a boolean used to specify if main interface function nmf
should store the option into the initial NMF object before performing
the computation.
|
NMF
. If argument builtin.only
is TRUE
then only the
models that are defined within the package are returned.
options
.
Invoking 'nmf.options()' with no arguments returns a list with the current values of the options.
To access the value of a single option, one should use nmf.getOption("error.track")
, e.g.,
rather than nmf.options("error.track")
which is a list
of length one.
For nmf.getOption
, the current value set for option name
, or NULL
if the option is unset.
For nmf.options()
, a list of all set options sorted by name. For
options(name)
, a list of length one containing the set value, or
NULL
if it is unset. For uses setting one or more options, a
list with the previous values of the options changed (returned
invisibly).
For nmf.models
, a character
vector listing the available NMF models.
'verbose'
(see below), but reports more information.
TRUE
then the error track can be plotted using method errorPlot
.
The step size of the error track is set via option track.interval
(see below).
Renaud Gaujoux renaud@cbio.uct.ac.za
# 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) ## Not run: 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())