R/argmin.R

Defines functions argmin

Documented in argmin

argmin=function(x){
    vx=as.vector(x)
    imax=order(vx)[1]
if(!is.matrix(x))imax
    else{
        d=dim(x)
        c1=as.vector(outer(seq(d[1]),rep(1,d[2])))[imax]
        c2=as.vector(outer(rep(1,d[1]),seq(d[2])))[imax]
        c(c1,c2)

    }
}

Try the sparsenet package in your browser

Any scripts or data that you put into this service are public.

sparsenet documentation built on May 29, 2017, 2:19 p.m.