Learn R Programming

gmgm (version 1.1.2)

reorder: Reorder the variables and the mixture components of a Gaussian mixture model

Description

This function reorders the variables and the mixture components of a Gaussian mixture model.

Usage

reorder(gmm, var = NULL, comp = NULL)

Value

The reordered gmm object.

Arguments

gmm

An object of class gmm.

var

A character vector containing the variables in the desired order. If variables are not specified, they are added after the ordered ones. If NULL (the default), the variables are not reordered.

comp

An integer vector containing the indexes of the mixture component in the desired order. If components are not specified, they are added after the ordered ones. If NULL (the default), the components are not reordered.

Examples

Run this code
data(gmm_body)
gmm_1 <- reorder(gmm_body, var = c("WAIST", "AGE", "FAT", "HEIGHT", "WEIGHT"),
                 comp = c(2, 1, 3))

Run the code above in your browser using DataLab