View source: R/FleetSegmentation.R
clustering_stockshares_table | R Documentation |
This function creates a table with the average shares of the stocks on the catch of each clusters vessel. The result is a data frame, which can be printed or stored as an object. Alternatively, an html-table can be created by setting style = "html".
clustering_stockshares_table(data, clustering, style = "basic")
data |
The original, untransformed data that was used for the clustering. |
clustering |
The result of the clustering procedure, stored as a data frame. |
style |
The style, in which the result is printed. Defaults to "basic". "html" produces an html-table. |
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_table(data = stockdata,clustering = clustering)
clustering_stockshares_table(data = stockdata,clustering = clustering,style = "html")
segments_stockshares <- clustering_stockshares_table(data = stockdata,clustering = clustering)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.