riditsrefgroup {ridittools}R Documentation

Utility to determine reference group. Primarily for internal use/

Description

For internal use.

Usage

riditsrefgroup(x, margin, ref = NULL)

Arguments

x

matrix of counts or proportions

margin

margin that represents groups. 1 for rows, 2 for columns

ref

group to use as reference. if omitted, use totals across groups. if a vector, use it. otherwise use the group with its number (or name if available)

Value

vector of counts/proportions to use as reference group

Author(s)

Eric Bohlman

Examples

## The function is currently defined as
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)
    }
  }

[Package ridittools version 0.1 Index]