R/riditsrefgroup.R

Defines functions riditsrefgroup

Documented in riditsrefgroup

riditsrefgroup <-
function(x, margin, ref=NULL) {
  if (length(ref) > 1) {
    refgroup <- ref
  } else if (length(ref) == 1) {
    if (margin==1) {
      refgroup <- x[ref,]
    } else {
      refgroup <- x[, ref]
    }
  } else {
    refgroup <- apply(x, 3-margin, sum)
  }
}

Try the ridittools package in your browser

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

ridittools documentation built on May 1, 2019, 6:30 p.m.