plot_clusters: Plot the clustering of the data.

View source: R/plot_clusters.R

plot_clustersR Documentation

Plot the clustering of the data.

Description

This functions plots the data as histogram, coloured according to the hard clustering assignments. This function must receive in input exactly the same data used for the fit.

Usage

plot_clusters(x, data)

Arguments

x

An object of class bmix that represents a fit.

data

The data used to compute the fit x.

Value

A ggplot object.

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)

plot_clusters(x, data)

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