numberclust_dendrogram: Plot dendrogram to identify number of clusters

View source: R/FleetSegmentation.R

numberclust_dendrogramR Documentation

Plot dendrogram to identify number of clusters

Description

This function plots a dendrogram of the clustering. The dendrogram can either be displayed without any further features or with the recommended cutting heights (setting dend_method to "range") or a cut at a defined linkage distance (setting dend_method to "cut").

Usage

numberclust_dendrogram(
  catchdata,
  distance = "jaccard",
  method = "average",
  dend_method = "basic",
  dend_cut = 0.75,
  range_min = 0.4,
  range_max = 0.8
)

Arguments

catchdata

The transformed catchdata created with catchdata_transformation()

distance

The distance measure used. Defaults to modified (metric-converted) Bray-Curtis distance. CAUTION! The clustering approach for the fleet segmentation is designed to work with modified (metric-converted) Bray-Curtis distance and the average linkage method! Changing either of them is not advised!

method

The link function used. Defaults to average linkage. CAUTION! The clustering approach for the fleet segmentation is designed to work with modified (metric-converted) Bray-Curtis distance and the average linkage method! Changing either of them is not advised!

dend_method

The style of the plotted dendrogram. "basic" returns a blank dendrogram, "range" a dendrogram with the recommended cutting heights depicted, "cut" enables the user to cut the dendrogram at a height of his choice. The resulting number of clusters will be shown in the plot.

dend_cut

The height used to cut the dendrogram. Defaults to 0.75, which showed to be the appropriate cutting height for various fleet data sets.

range_min

The lower border of the cutting range set for a dendrogram with the "range"- method

range_max

The upper border of the cutting range set for a dendrogram with the "range"- method

Examples

library(tidyverse)
data <- example_catchdata
stockdata <- assign_stocks(data=data)
catchdata <- catchdata_transformation(data = stockdata)
numberclust_dendrogram(catchdata=catchdata) ### basic dendrogram
numberclust_dendrogram(catchdata=catchdata, dend_method= "range")
### dendrogram with range of good cutting heights
numberclust_dendrogram(catchdata=catchdata, dend_method= "cut", dend_cut = 0.75)
### dendrogram with cut at a linkage distance of 0.75 and the number of resulting clusters

ESulanke/FleetSegmentation documentation built on March 27, 2023, 10:13 p.m.