View source: R/FleetSegmentation.R
clustering_stockshares_plot | R Documentation |
This is function creates an overview barplot of the average shares of stocks on the catch of each clusters vessels.
clustering_stockshares_plot(
data,
clustering,
min_share = 5,
label_wrap = 6,
display_cluster_size = F,
subset = NULL
)
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%. |
label_wrap |
Indicates the number of characters per line before a line break in the stock labels. Defaults to 6. |
display_cluster_size |
Indicates, whether the number of vessels in each cluster should be displayed in the plot. Defaults to FALSE. |
subset |
Display only a subset of clusters in plot. Can be a single number or a vector of numbers. |
library(tidyverse)
data <- example_catchdata
stockdata <- assign_stocks(data=data)
catchdata <- catchdata_transformation(data = stockdata)
clustering <- segmentation_clustering(catchdata = catchdata,n_cluster = 6)
clustering_stockshares_plot(data = stockdata,clustering = clustering)
clustering_stockshares_plot(data = stockdata,clustering = clustering,
min_share=10,label_wrap=10, display_cluster_size=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.