expandCategories {dembase} | R Documentation

## Expand a single category into multiple categories.

### Description

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

### Usage

    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`

[Package dembase version 0.0.0.119 Index]