I am pretty new using R, I have to program a new NMF algorithm to be used as the parameter method
when the function nmf()
is called.
As a way to start I would like to view the source code of the built-in algorithms as brunet, KL, lee, but I am unable to find it. Can someone help me please?
You can download the source here and then inspect the code for the function you are interested in. Additionally, try typing the name of the function at the console. If it is written in R you may see the whole function printed out. E.g.
f <- function(x) {return(x^2)}
f
function(x) {return(x^2)}
If the function is written in C/C++ it will give you information that it is compiled and you can look for the function in the downloaded source code, e.g.
head
function (x, ...)
UseMethod("head")
<bytecode: 0x10a0d9158>
<environment: namespace:utils>