R: Converting data types in CA and MCA

caconv {ca} | R Documentation

## Converting data types in CA and MCA

### Description

Conversion from and to a number of different data types commonly used in CA and MCA (frequency tables, response pattern matrices, indicator matrices and Burt matrices).

### Usage

    caconv(x, from = c("freq", "rpm", "ind", "Burt"), to = c("rpm", "ind", "Burt", "freq"),
                  nlev = NA, vars = c(1,2), ...)

### Arguments

`x` | A matrix (two-way frequency table, indicator matrix, or Burt matrix) or data frame (response pattern matrix).
`from` | The type of input data in `x`: a frequency table (`"freq"`), or a response pattern matrix (`"rpm"`), or an indicator matrix (`"ind"`), or a Burt matrix (`"Burt"`).
`to` | The data type into which `x` should be converted.
`nlev` | A vector containing the number of levels for each categorical variable (for `from="ind"` or `from="Burt"`). If `NA`, `nlev` is computed from the data.
`vars` | A vector of length 2 specifying the index of the variables to use for converting to `"freq"` (i.e. to a regular two-way frequency table).
`...` | Further arguments (ignored).

### Details

The function `caconv` converts between data types in CA and MCA. Note that a conversion from `from="Burt"` to `to="ind"` or `to="rpm"` is not supported.

### Value

A matrix or data frame containing the converted data (with the type specified in `to`).

### See Also

`ca`,`mjca`

[Package ca version 0.70 Index]