single_cluster_stockshares: Plot stock shares of clusters

View source: R/FleetSegmentation.R

single_cluster_stocksharesR Documentation

Plot stock shares of clusters

Description

This is function creates an overview barplot of the average shares of stocks on the catch of all the vessels in one cluster.

Usage

single_cluster_stockshares(
  data,
  clustering,
  min_share = 5,
  cluster.number,
  label_wrap = 15
)

Arguments

data

The original, untransformed data that was used for the clustering.

clustering

The result of the clustering procedure, stored as a data frame.

min_share

The minimum average percentage share a stock has to have to be labelled in the plot. Defaults to 5%.

cluster.number

The number of the cluster of which vessel stock shares should be displayed.

label_wrap

Indicates the number of characters per line before a line break in the stock labels. Defaults to 15.

Examples

library(tidyverse)
data <- example_catchdata
stockdata <- assign_stocks(data=data)
catchdata <- catchdata_transformation(data = stockdata)
clustering <- segmentation_clustering(catchdata = catchdata,n_cluster = 6)
single_cluster_stockshares(data = stockdata,clustering = clustering, cluster.number=1)

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