Learn R Programming

iClusterVB (version 0.1.4)

piplot: Generates a probability inclusion plot based on an iClusterVB object

Description

Generates a probability inclusion plot based on an iClusterVB object

Usage

piplot(
  fit,
  plot_grid = TRUE,
  ylab = "Probability of Inclusion",
  title = NULL,
  ...
)

Value

Returns a probability inclusion plot or plots.

Arguments

fit

A fitted iClusterVB object.

plot_grid

LOGICAL. Whether to use the plot_grid function from the cowplot package. The default is TRUE.

ylab

The y-axis label. The default is "Probability of Inclusion".

title

The title of the plots. It can be a character vector or a single value. The default output is "View 1 - Distribution 1", ..., "View R - Distribution R".

...

Additional arguments to add to the plot_grid function.

Examples

Run this code
# Setting up the data
dat1 <- list(
  gauss_1 = sim_data$continuous1_data[c(1:20, 61:80, 121:140, 181:200), 1:75],
  gauss_2 = sim_data$continuous2_data[c(1:20, 61:80, 121:140, 181:200), 1:75],
  poisson_1 = sim_data$count_data[c(1:20, 61:80, 121:140, 181:200), 1:75])


dist <- c(
  "gaussian", "gaussian",
  "poisson")

fit_iClusterVB <- iClusterVB(
  mydata = dat1,
  dist = dist,
  K = 4,
  initial_cluster= c(rep(1, 20), rep(2, 20), rep(3, 20), rep(4, 20)),
  VS_method = 1,
  max_iter = 20
)

piplot(fit_iClusterVB, plot_grid = FALSE)

Run the code above in your browser using DataLab