segmentation_clustering: Perform clustering

View source: R/FleetSegmentation.R

segmentation_clusteringR Documentation

Perform clustering

Description

This is the core function to perform the clustering of the catchdata. Use the number of suitable number of clusters estimated with numberclust_table() and numberclust_plot(). A modified (metric-converted) Bray-Curtis distance matrix is computed from the input data, the clustering is performed as a hierarchical agglomerative clustering (HAC) using the average linkage link function. The function creates a new data frame, which can be printed or stored.

Usage

segmentation_clustering(
  catchdata,
  n_cluster,
  distance = "jaccard",
  method = "average"
)

Arguments

catchdata

The transformed catchdata created with catchdata_transformation()

n_cluster

The number of clusters to be generated. No default.

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!

Examples

library(tidyverse)
data <- example_catchdata
stockdata <- assign_stocks(data=data)
catchdata <- catchdata_transformation(data = stockdata)
clustering <- segmentation_clustering(catchdata = catchdata,n_cluster = 6)

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