26 Aug 2017
equivalent to sweep(x, margin, margin.table(x, margin), "/") except that it returns gets x/sum(x) if margin has length zero
sweep(x, margin, margin.table(x, margin), "/")
gets x/sum(x)
m <- matrix(1:4, 2) prop.table(m, 1)
viewed on http//www.rfunction.com
R
function
matrix