bcluster: Wrapper function for b-cluster analysis

View source: R/bcluster.R

bclusterR Documentation

Wrapper function for b-cluster analysis

Description

By default, bcluster calls a function to perform b-cluster analysis by a non-hierarchical iterative ascent algorithm, then inspects results if there are multiple runs.

Usage

bcluster(
  X,
  inspect = TRUE,
  inspect.plot = TRUE,
  algorithm = "n",
  measure = "b",
  G = NULL,
  M = NULL,
  max.iter = 500,
  X.input = "data",
  tol = 1e-12,
  runs = 1,
  seed = 2021
)

Arguments

X

three-way array with I assessors, J products, M

inspect

default (TRUE) calls the inspect function to evaluate all solutions (when runs>1)

inspect.plot

default (TRUE) plots results from the inspect function

algorithm

default is n for non-hierarchical; h for hierarchical

measure

default is b for the b-measure (other options not yet implemented)

G

number of clusters (required for non-hierarchical algorithm)

M

initial cluster memberships

max.iter

maximum number of iteration allowed (default 500)

X.input

specifies input format; for any b-cluster analysis, "data" (default); for non-hierarchical cluster analysis only, "bc" or "bcdiff" (see input parameter X)

tol

non-hierarchical algorithm stops if variance over 5 iterations is less than tol (default: 1e-12)

runs

number of runs (defaults to 1)

seed

for reproducibility (default is 2021)

Value

list with elements:

  • runs : b-cluster analysis results from bcluster.n or bcluster.h (in a list if runs>1)

  • inspect : result from inspect (the plot from this function is rendered if inspect.plot is TRUE)

References

Castura, J.C., Meyners, M., Varela, P., & Næs, T. (2022). Clustering consumers based on product discrimination in check-all-that-apply (CATA) data. Food Quality and Preference, 104564. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.foodqual.2022.104564")}.

Examples

# b-cluster analysis on the first 8 consumers and the first 5 attributes
(b1 <- bcluster(bread$cata[1:8,,1:5], G=2, seed = 123))
# Since the seed is the same, the result will be identical to
# (b2 <- bcluster.n(bread$cata[1:8,,1:5], G=2, seed = 123))
b3 <- bcluster(bread$cata[1:8,,1:5], G=2, runs = 5, seed = 123)

cata documentation built on Aug. 1, 2026, 1:06 a.m.

Related to bcluster in cata...