Learn R Programming

clustNet (version 1.2.0)

density_plot: density_plot

Description

Create 2d dimensionality reduction of sample fit to Bayesian network clusters

Usage

density_plot(cluster_results, var_selection = NULL, colourys = NULL)

Value

A density plot of class recordedplot.

Arguments

cluster_results

Cluster results from function get_clusters

var_selection

Selected variables to consider, e.g. c(1:5) for first five only

colourys

A vector specifying the colors of each cluster (optional)

Examples

Run this code
# \donttest{
# Simulate data
sampled_data <- sampleData(n_vars = 15, n_samples = c(200,200,200))$sampled_data
# Learn clusters
cluster_results <- get_clusters(sampled_data)
# Load additional pacakges to create a 2d dimensionality reduction
library(car)
library(ks)
library(ggplot2)
library(graphics)
library(stats)
# Plot a 2d dimensionality reduction
density_plot(cluster_results)
# }

Run the code above in your browser using DataLab