Sparameters.variables.reorder.default: General Default ordering of variables for synthetisation...

Description Usage Arguments Details Value Examples

View source: R/syn2.R

Description

General Default ordering of variables for synthetisation based on name of the variable.

Usage

1
2
3
4
5
6
Sparameters.variables.reorder.default(
  variables,
  orderwithinorigin = NULL,
  id = NULL,
  extrasort = NULL
)

Arguments

variables

vector of character strings, indicating names of variables

orderwithinorigin

a list, see example

id

a vector of character strings

extrasort

(default=NULL) list variables that should be used for an additional ordering

Details

After transposition, variable names follow this format: origin.variablename_margin1_margin2....lastmargin Some rules have to be followed:

- Missing indicators have to be synthesised before the corresponding variables, for example AA.factor1missingind_L1_L2_L1 needs to be synthesised before AA.factor1missingind_L1_L2_L1

- Cell indicators must be synthesised before the corresponding variables. For example AA.present_L1_L2_L1 must be synthesised before AA.factor1_L1_L2_L1 and before AA.cont1_L1_L2_L1

- Parent variables (aggregated) must be synthesised before their children: For example AA.present_L1 must be synthesised before AA.present_L1_L2, AA.cont2_L1_L2 must be synthesised before AA.cont2_L1_L2_L3 AA.present_L1 must be synthesised before AA.present_L1_L3 AA.cont2missingind_L1 must be synthesised before AA.cont2missingind_L1_L3

- if for examples variable AA.cont1 in each cell has to be synthesised before AA.cont2, this can be specified with the orderwithinorigin argument

- for the use of the argument extrasort, refer to sorttablewithingroup

Value

a list.

Examples

1
2
3
4
5
6
7
TK<-Tsampledata(TRUE)$TtableA
Sparameters.variables.reorder.default(names(TK$TtableA))
#Second example: no transposing variables
TtableA<-Tsampledata(TRUE)$TtableA
orderwithinorigin=c("AA.factor1","AA.factor2")
variables<-names(TtableA)
Sparameters.variables.reorder.default(variables,orderwithinorigin)

DanielBonnery/BigSyn documentation built on June 28, 2020, 7:18 p.m.