View source: R/FleetSegmentation.R
numberclust_dendrogram | R Documentation |
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").
numberclust_dendrogram(
catchdata,
distance = "jaccard",
method = "average",
dend_method = "basic",
dend_cut = 0.75,
range_min = 0.4,
range_max = 0.8
)
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 |
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.