# Vignette on the usage of DBCVindex

This vignette documents how to use the `DBCVindex` library in R. The DBCV index is a coefficient that assesses the results of clustering results, taking into account the density-based components of clustering.

Let’s suppos you have the `moons` data and that you want to apply the HDBSCAN algorithm with 5 minimal points to them:

    if (!requireNamespace("pacman", quietly = TRUE)) {
      install.packages("pacman")
    }

    library("pacman")
    p_load("DBCVindex, dbscan")

    data("moons")
    these_minimal_points <- 5
    clustering_results <- hdbscan(moons, minPts = these_minimal_points)

You can calculate the DBCV of HDBSCAN clusters this way:

    cat("DBCV index = ", dbcv_index(moons, clustering_results$"cluster"), " in the [-1;+1] interval\n", sep="")