prCaReorderReferenceDescribe: Adds the ordering, references, and descriptions

View source: R/private_printCaA.R

prCaReorderReferenceDescribeR Documentation

Adds the ordering, references, and descriptions

Description

This is a wrapper function around some more basic functions that printCrudeAndAdjustedModel() uses.

Usage

prCaReorderReferenceDescribe(
  x,
  model,
  order,
  var_order,
  add_references,
  add_references_pos,
  reference_zero_effect,
  ds,
  desc_column,
  desc_args,
  use_labels
)

Arguments

x

The main value matrix from the prCaPrepareCrudeAndAdjusted()

model

The model

order

A vector A vector with regular expressions for each group.

var_order

The output from the prMapVariable2Name()

add_references

True if it should use the data set to look for references, otherwise supply the function with a vector with names. Sometimes you want to indicate the reference row for each group. This needs to be just as many as the groups as the order identified. Use NA if you don't want to have a reference for that particular group.

add_references_pos

The position where a reference should be added. Sometimes you don't want the reference to be at the top, for instance if you have age groups then you may have < 25, 25-39, 40-55, > 55 and you have the reference to be 25-39 then you should set the reference list for age_groups as add_references_pos = list(age_groups = 2) so that you have the second group as the position for the reference.

reference_zero_effect

Used with references, tells if zero effect is in exponential form, i.e. exp(0) = 1, or in regular format, i.e. 0 = 0 (can be set to any value)

ds

The dataset from the model

desc_column

Add descriptive column to the crude and adjusted table

desc_args

The description arguments that are to be used for the the description columns. The options/arguments should be generated by the caDescribeOpts function.

use_labels

If the rowname.fn function doesn't change the name then the label should be used instead of the name, that is if there is a label and it isn't a factor.

Value

The reordered groups as a matrix

See Also

Other printCrudeAndAdjusted functions: prCaAddRefAndStat(), prCaAddReference(), prCaAddUserReferences(), prCaGetImputationCols(), prCaGetRowname(), prCaGetVnStats(), prCaPrepareCrudeAndAdjusted(), prCaReorder(), prCaSelectAndOrderVars(), prCaSetRownames()


gforge/Greg documentation built on Feb. 3, 2024, 5:37 a.m.