Clusters: Extract clustering assignments.

View source: R/getters.R

ClustersR Documentation

Extract clustering assignments.

Description

This function extracts the clustering assignments and the latent variables from the fit. This function must receive in input exactly the same data used for the fit.

Usage

Clusters(x, data)

Arguments

x

An object of class bmix that represents a fit.

data

The data used to compute the fit x.

Value

The input data transformed into a tibble, augmented with a column for the cluster labels and the latent variables.

Examples

# The same dataset used in the package vignette
data = data.frame(successes = c(rbinom(30, 100, .4), rbinom(70, 100, .7)), trials = 100)

# BMix fit with default parameters
x = bmixfit(data)

Clusters(x, data)

caravagn/BMix documentation built on May 10, 2022, 7:41 p.m.