R/getMargins.R

getMargins <-
function(x){
	if( !is.array(x) ){ warning(paste0(sQuote("x"), " must be matrix or array")) }
return(lapply(1:length(dim(x)), function(v){ apply(x,v,sum) }))
}

Try the hypergea package in your browser

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

hypergea documentation built on May 2, 2019, 2:40 a.m.