View source: R/FleetSegmentation.R
numberclust_clustree | R Documentation |
This function creates a clustering tree with the clustree()-function from the eponymous package. It visualizes the clustering process by showing the splits of the clusters in a tree plot. This a very useful method for identifying major segmentations of big groups in the data and ultimately deciding on how many clusters to use.
numberclust_clustree(
catchdata,
max_clusternumber = ifelse(nrow(catchdata) <= 15, (nrow(catchdata) - 1), 15),
distance = "jaccard",
method = "average"
)
catchdata |
The transformed catchdata created with catchdata_transformation() |
max_clusternumber |
The maximum number of clusters to be expected. Defaults to 1 less than the number of ships in the catchdata-frame, up to a maximum of 15. |
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! |
library(tidyverse)
data <- example_catchdata
stockdata <- assign_stocks(data=data)
catchdata <- catchdata_transformation(data = stockdata)
numberclust_clustree(catchdata = catchdata,max_clusternumber = 15)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.