plot_dist: Plot Distribution of distances

View source: R/visualization.R

plot_distR Documentation

Plot Distribution of distances

Description

This function creates a histogram of the simulated and observed distances of a ClusterSet object.

Usage

plot_dist(
  object,
  bins = 150,
  alpha = 0.5,
  colors = c(Simulated = "#FB8500", Observed = "#36949D"),
  xlim = NULL,
  vline_color = "#4f6d7a",
  text_size = 4,
  text_hjust = -0.8,
  text_vjust = -0.5
)

Arguments

object

A ClusterSet object.

bins

The number of bins to use in the histogram (default is 150).

alpha

The level of transparency for the bars in the histogram (default is 0.5).

colors

A named vector of colors to use for the histograms, with "Simulated" and "Observed" as the named elements (default is c("Simulated" = "#FB8500", "Observed" = "#36949D")).

xlim

Limits for the x axis of the histogram (e.g. c(0.8, 1)).

vline_color

Color of the vertical line indicating the critical distance with KNN.

text_size

Font size for the label of the critical distance.

text_hjust

Horizontal justification for the label of the critical distance.

text_vjust

Vertical justification for the label of the critical distance.

Value

A ggplot object.

Examples

# Set verbosity to 1 to display info messages only.
set_verbosity(1)

# Load datasets
load_example_dataset('7871581/files/pbmc3k_medium_clusters')
plot_dist(pbmc3k_medium_clusters)


dputhier/dbfmcl documentation built on May 31, 2024, 8:57 a.m.