Given a crosstabs object, sort the named variables alphabetically.

The difference between a topline and a crosstabe from the perspective of tabbook is that a topline only has a crosstab called "Results" contained within it. Otherwise, the crosstab object has an embedded summary object per each banner defined

sortAliases(
  ct,
  vars = NULL,
  descending = NULL,
  alpha = FALSE,
  fixed = NULL,
  pin_to_top = NULL,
  pin_to_bottom = NULL
)

sortResults_outer(var, descending, alpha, fixed, pin_to_top, pin_to_bottom)

sortResults_inner(r, descending, alpha, fixed, pin_to_top, pin_to_bottom)

Arguments

ct

A crosstabs object

vars

A character vector of variable aliases that should be sorted. Or a single alias if pin_to_top or pin_to_bottom are specified.

descending

Logical, defaults to NULL. If data are of type TextVariable or DateTimeVariable, default to ascending, if numeric defaults to descending. If FALSE, enforces ascending. If TRUE, enforces descending.

alpha

Logical. Defaults to FALSE. Should data be sorted alphabetically?

fixed

A character vector representing a set order of presentation

pin_to_top

A character vector of response values to pin to the top of the result presentation

pin_to_bottom

A character vector of response values to pin to the bottom of the result presentation

var

An internal crosstabs elements (Usually ct$results[[x]])

r

The results of a specific banner or Results