expandCategories: Expand a single category into multiple categories.

Description Usage Arguments See Also

Description

Using a ManyToOne concordance, expand the categories used by one or more dimensions of a demographic array.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
expandCategories(
  object,
  dimension = NULL,
  old,
  new,
  concordance,
  weights = NULL,
  means = FALSE,
  n = NULL
)

## S4 method for signature 'Counts,ANY,missing,missing,ManyToOne'
expandCategories(
  object,
  dimension,
  concordance,
  weights = NULL,
  means = FALSE,
  n = NULL
)

## S4 method for signature 'Values,ANY,ANY,ANY,missing'
expandCategories(object, dimension, old, new, weights)

## S4 method for signature 'Values,ANY,missing,missing,ManyToOne'
expandCategories(object, dimension, concordance, weights)

Arguments

object

Object of class DemographicArray.

dimension

Character or numeric vector giving the name or index of the dimension where the categories are found - or names or indices if more than one dimension is being changed.

old

Character vector of length 1 containing the name of the category to be expanded.

new

Character vector giving the names of the new categories.

concordance

Object of class "ManyToOne".

weights

Object of class Counts.

means

If FALSE (the default) the allocation is done randomly; if TRUE, values are set equal to their means.

n

Number of iterations to generate. Ignored if counts or weights has a dimension with dimtype "iteration".

See Also

collapseCategories


StatisticsNZ/dembase documentation built on Dec. 25, 2021, 4:49 p.m.